Client Side Things
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Codewalkers ForumsOther TechnologiesClient Side Things

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Codewalkers Forums Sponsor:
  #1  
Old November 29th, 2004, 06:33 PM
Anonymous Anonymous is offline
Registered User
Codewalkers God 35th Plane (22000 - 22499 posts)
 
Join Date: Apr 2007
Posts: 22,309 Anonymous User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 24
background image in ie downloaded every time...

i have a loop where each iteration changes background image of div with this line
divid.style.backgroundImage="url(images/face.png)"

the problem is that IE always downloads the image despite that it already was displayed many times earlier.... and as a result the effect is very slow...

Is there a way to cashe this image and then use it as background image?
(so IE doesn't download it every time it needs to be displayed)



thank you


Reply With Quote
  #2  
Old December 2nd, 2004, 03:02 AM
rehfeld_dot_us rehfeld_dot_us is offline
Codewalkers Novice (500 - 999 posts)
 
Join Date: Apr 2007
Posts: 825 rehfeld_dot_us User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 2
RE: background image in ie downloaded every time...

put this in your images folder on your server

save it as .htaccess

Code:

ExpiresActive On
ExpiresDefault "access plus 2 months"


your server should now send the proper expires headers along w/ the images, and IE should cache them now.

Reply With Quote
  #3  
Old December 2nd, 2004, 09:11 AM
Anonymous Anonymous is offline
Registered User
Codewalkers God 35th Plane (22000 - 22499 posts)
 
Join Date: Apr 2007
Posts: 22,309 Anonymous User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 24
RE: background image in ie downloaded every time...

thanks for replying
for now i know that my apache does send 304 responce
so everything is ok on server side.(i see it in logs)
(i also tried to send "expires" header with each image but this doesn't help)

what i know for now is that it is not the fault of server side but IE's
what is really happening is that ie, no matter what ,always tries to download the image despite 304 answer...
i also managed to isolate the cause of when ie wants to download the images again...it happens every time something on page needs to be redrawn or shown or moved...IE tries to download ALL affected images and backgrounds.

for example i have some simple slide show from two images.first image(pic1.png) appears, secong image(pic2.png) disappears and that repeats itself again. the moment each image appears i see in status bar message "downloading pic1.png..." or "downloading pic2.png" and if this slideshow runs every 100msec then each and every time ie tries to download these images and also all other images that are affected by these two...
(by the way the same thing happens in opera)

but in firefox everything is fine...

this 100% ie rendering issue and i'm not sure whether it is possible to fix it...i posted about this problem on couple of others forums but noone seems to know what to do...for example see here:
http://www.webdeveloper.com/forum/showthread.php?postid=282195

Reply With Quote
  #4  
Old December 3rd, 2004, 07:36 PM
rehfeld_dot_us rehfeld_dot_us is offline
Codewalkers Novice (500 - 999 posts)
 
Join Date: Apr 2007
Posts: 825 rehfeld_dot_us User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 2
RE: background image in ie downloaded every time...

im pretty familiar w/ this problem


sending the expires headers has always worked for me.

have you changed your cache settings in ie?

often people who build websites have changed them

tools>internet options>general tab>settings

if you have it set to "every visit to page", that could be your problem

when set to "automatically", the expires headers makes it behave as we want, at least on my system (ie6 both sp1 and sp2, xp pro)

i know of a css method that will work regardless, but it involves using a background image and an img tag on top of it. it can only switch between 2 images, but it WILL do it flicker free w/out js

if that sounds like it will work for you, ill post a demo.

but it sounds like you need to switch between multiple images, you said loop.

have you tried preloading the images in js?

one time i was able to use css to switch between multpile images using just css, flicker free, but it was very complex, and wasnt very portable(a ton of style rules and markup). it was about a year ago so i dont remember exactly how i did it, but im sure i could reproduce it if it tried.

theres also this little gem(not really realted to your problem, but you might find it intresting). its a kinda a bulky download for your users, but as long as its cached after the first request, its absolutely great. makes ie VERY standards compliant

http://dean.edwards.name/ie7/




Reply With Quote
  #5  
Old December 3rd, 2004, 08:09 PM
rehfeld_dot_us rehfeld_dot_us is offline
Codewalkers Novice (500 - 999 posts)
 
Join Date: Apr 2007
Posts: 825 rehfeld_dot_us User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 2
RE: background image in ie downloaded every time...

see if this works for you

http://rehfeld.us/hover.html


you know i even tried it w/out the expires headers and it still worked. maybe the etag header header comes into play here, and makes ie behave or something.


i realize a 304 response from your server _SHOULD_ tell ie not to redownload it, period.

but, this is ie were talking about after all lol

i can even download the page in ie, then delete the file from my server, and keep hovering over the image in the page i downloaded, and it works. this tells me ie is NOT even bothering to contact my server between hovers.

Reply With Quote
Reply

Viewing: Codewalkers ForumsOther TechnologiesClient Side Things > background image in ie downloaded every time...


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump



 Free IT White Papers!
 
How to Present Effectively Online
This white paper offers practical and actionable advice on the key steps that any presenter should consider as they plan and execute a Webinar or online meeting.

Request Your Free Technology Downloads!
 
Open Source Security Myths
Open Source Software (OSS) is computer software whose source code is available to the general public with relaxed or non-existent intellectual property restrictions (or arrangement such as the public domain), and is usually developed with the input of many contributors.

Request Your Free Technology Downloads!
 
Power and Cooling Capacity Management for Data Centers
This paper describes the principles for achieving power and cooling capacity management.

Request Your Free Technology Downloads!
 
Scalable, Fault-Tolerant NAS for Oracle - The Next Generation
For several years NAS has been evolving as a storage alternative for Oracle databases, and for good reason: NAS is quite often the simplest, most cost-effective storage approach for Oracle. Learn about the benefits that HP's approach to scalable NAS brings to Oracle environments in this comprehensive white paper.

Request Your Free Technology Downloads!
 
Understanding Web Application Security Challenges
This white paper discusses many common threats and preventive measures for Web application security, and explains what you can do to help protect your organization.

Request Your Free Technology Downloads!
 

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2009 by Developer Shed. All rights reserved. DS Cluster 6 hosted by Hostway
Stay green...Green IT