Note that there are some explanatory texts on larger screens.

plurals
  1. POnew image makes http request even though cached?
    primarykey
    data
    text
    <p>I have a javascript slide show that creates the next slide dynamically and then moves it into view. Since the images are actually sprites, the src is transparent.png and the actual image is mapped via <code>background:url(</code>.. in css.</p> <p>Every time (well, most of the time) the script creates a <code>new Element</code>, Firefox makes an http request for transparent.png. I have a far-future expires header, and Firefox is respecting all other files' expiries.</p> <p>Is there a way to avoid these unnecessary requests. Even though the server is returning <code>304 unmodified</code> responses, it would be nice if Firefox would respect the expiries on dynamically created images.</p> <p>I suspect that if I injected a simple string instead of using <code>new Element</code>, this might solve the problem, but I use some methods on Prototypes extended <code>Element</code> object, so I would like to avoid a bunch of html strings in my js file.</p> <p>This is a nit-picky question, but I'm working on front-end optimization now, so I thought I would address it.</p> <p>Thanks.</p> <p>@TJ Crowder Here are two images: <a href="http://tinypic.com/r/29kon45/5" rel="nofollow noreferrer">http://tinypic.com/r/29kon45/5</a>. The first shows that the requests for trans.png are proliferating. The second shows an example of the headers. Thanks</p> <p>@all Just to reiterate: what's real strange is that it only makes these unnecessary requests about half the time, even though all images are created via identical logic.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload