473,698 Members | 1,985 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

IE6 Requests CSS Background Image Every Time!

Hi,
I found a bug in IE6, though it is known already. If I have a CSS
background property set to some image, such as
background:url( myimg.gif);, and I apply this property to some html
element, say DIV, and refresh DIV every 10 seconds, background image
is reguested every 10 seconds for IE6, too.

The fix which I found did not fix the problem:
try {
document.execCo mmand("Backgrou ndImageCache", false, true);
} catch(err) {}

Relative info:
http://www.mister-pixel.com/#Content...is_that_simple
http://dean.edwards.name/my/flicker.html
http://www.fivesevensix.com/studies/ie6flicker/

What's the known workaround?

May 7 '07 #1
4 4231
On May 7, 8:59 am, vunet...@gmail. com wrote:
The fix which I found did not fix the problem:
try {
document.execCo mmand("Backgrou ndImageCache", false, true);

} catch(err) {}
What's the known workaround?
It seems to work for me. I have this in many of my site js files:

// Turn on background image caching in IE
// --------------------------------------
/*@cc_on
if (document && document.execCo mmand) {
try { document.execCo mmand("Backgrou ndImageCache",f alse,true); }
catch (e) { }
}
@*/

Matt Kruse
http://www.JavascriptToolbox.com

May 7 '07 #2
On May 7, 10:08 am, Matt Kruse <m...@mattkruse .comwrote:
On May 7, 8:59 am, vunet...@gmail. com wrote:
The fix which I found did not fix the problem:
try {
document.execCo mmand("Backgrou ndImageCache", false, true);
} catch(err) {}
What's the known workaround?

It seems to work for me. I have this in many of my site js files:

// Turn on background image caching in IE
// --------------------------------------
/*@cc_on
if (document && document.execCo mmand) {
try { document.execCo mmand("Backgrou ndImageCache",f alse,true); }
catch (e) { }}

@*/

Matt Krusehttp://www.JavascriptT oolbox.com
Hmmm... Maybe it works, but my access.log file in Tomcat shows these
images are requested every time. How do you know if it works for you?
Thanks.

May 7 '07 #3
On May 7, 10:38 am, vunet...@gmail. com wrote:
On May 7, 10:08 am, Matt Kruse <m...@mattkruse .comwrote:
On May 7, 8:59 am, vunet...@gmail. com wrote:
The fix which I found did not fix the problem:
try {
document.execCo mmand("Backgrou ndImageCache", false, true);
} catch(err) {}
What's the known workaround?
It seems to work for me. I have this in many of my site js files:
// Turn on background image caching in IE
// --------------------------------------
/*@cc_on
if (document && document.execCo mmand) {
try { document.execCo mmand("Backgrou ndImageCache",f alse,true); }
catch (e) { }}
@*/
Matt Krusehttp://www.JavascriptT oolbox.com

Hmmm... Maybe it works, but my access.log file in Tomcat shows these
images are requested every time. How do you know if it works for you?
Thanks.
Additional word. It solved the problem (with JS or server
configuration) by sending HTTP 304 (not modified) instead of earlier
200 (request ok). But I do not to see those requests at all. How
possible is it?

May 7 '07 #4
The most effective way to solve this problem (and improve the
performance of your application at the same time) is to apply caching
header directives. All images should have a caching header indicating
when the image should expire from the cache. With this header IE will
cache the image and not continually make requests over and over.
Tomcat does not have the ability to do this out of the box. I
actually just finished a release of a little Tomcat/J2EE app server
plugin (a filter) that makes this very easy to do. You can take a look
and download Resource Accelerate at http://www.xucia.com/#Resource%20Accelerate.
This should apply caching headers for you and fix your multiple
request problem.
Kris
www.xucia.com

On May 7, 7:47 am, vunet...@gmail. com wrote:
On May 7, 10:38 am, vunet...@gmail. com wrote:


On May 7, 10:08 am, Matt Kruse <m...@mattkruse .comwrote:
On May 7, 8:59 am, vunet...@gmail. com wrote:
The fix which I found did not fix the problem:
try {
document.execCo mmand("Backgrou ndImageCache", false, true);
} catch(err) {}
What's the known workaround?
It seems to work for me. I have this in many of my site js files:
// Turn on background image caching in IE
// --------------------------------------
/*@cc_on
if (document && document.execCo mmand) {
try { document.execCo mmand("Backgrou ndImageCache",f alse,true); }
catch (e) { }}
@*/
Matt Krusehttp://www.JavascriptT oolbox.com
Hmmm... Maybe it works, but my access.log file in Tomcat shows these
images are requested every time. How do you know if it works for you?
Thanks.

Additional word. It solved the problem (with JS or server
configuration) by sending HTTP 304 (not modified) instead of earlier
200 (request ok). But I do not to see those requests at all. How
possible is it?- Hide quoted text -

- Show quoted text -

May 8 '07 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
10472
by: Markus Mohr | last post by:
Hi, everyone, I have a special problem: For every monitor resolution in 200 pixel steps from 800 to 1600 pixels I have an image to be shown as centered background-image. Those images all have the same name and reside in the following physical path structure:
23
7719
by: Erik Schulp | last post by:
Hi all, I am using a background image via a stylsheet. I've used this code: background-image:url("/images/tile.gif"); (which I think is correct) The image doesn't show up however, the path, the filename etc etc, everything checks out ok.
3
2095
by: Bond | last post by:
how do I know when the browser is making a request to the server? I am not having an onclick event for EVERY hyperlink, submit, etc. There must be some javascript function that I can overwrite that will allow me to do something when the browser requests something from the server. My plan is whenever a browser is about to request something from the server to create a time stamp and then compare this time to the time when the page...
13
3963
by: Giggle Girl | last post by:
Hi there, I need to use a background image in a TR that does NOT restart everytime it hits a TD. Can it be done? Specifically, if you set a background image for an entier table, now mater how many TRs and TDs you have, it will show the complete/unfragmented image (as long as you don't over-ride it). When I set a TR background image, every time I hit a TD it "re-seeds" the image. I want to have a TR that shows an 800px image in it's
4
13719
by: Steve Dambrowski | last post by:
How do I make my background image fit the screen so no one has to scroll, and at the same time it's not tiled looking?? I have one that is 800x600 and one that is 1084x768. The small one tiles.. and the big one cuts off the bottom. http://www.azclan.net/index2.html is currently the larger jpg.
6
7231
by: Rob | last post by:
Hello, I'm sure this has come up before. I have need for a collection of all elements/objects in an HTML document that have any kind of an attribute (HTML or CSS) that is making use of a URL to display an image. document.images only seems to reference image tags. The collection needs to include background images, input type = image, image maps, css assigned background, etc. Honestly, I am probably not aware of all the possibilities...
4
14647
by: GArlington | last post by:
I am trying to implement an image map (in this particular case a country map) with few <area ...>s on it. The challenge is to add background image (dot) to each <areaso it will display over the image map. I am failing miserably at that. Anybody tried to do that before? Anybody succeeded?
7
3145
by: =?Utf-8?B?Vkg=?= | last post by:
Hi, all. Need help with what seems to be either connection, or threading problem in my ASP.NET 2.0 application. The gist of the problem is this: IHttpHandler in my application serves an HTML page that has two images (image A and image B) in it. Once the HTML page is served, expected behavior is this: 1) receive request for image A, 2) receive request for image B almost at the same time as for A,
0
9157
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8861
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7721
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6518
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5860
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4366
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4615
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3045
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2327
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.