Image object ignoring http expirey and loading from cache

J

Jarson

I am building a dashboard client that will, among other things, every
half-hour update images that show local weather and other graphics. The
images change over time, so what my JavaScript fetches must not come from
the browser cache. The servlets that generate the images set the httpd
Expires date to yesterday to prevent this, but it doesn't seem to be
recognized by the JavaScript.

A work-around is to append a unique parameter after the image name (i.e.
image += '?' new Date().getTime() ) however, this is a hack that seems
needed only because the Image object is not properly recognizing expired
data. Am I right? Is there a better way to tell the object to load from the
source and not the cache?

Jarson
(jarson from sygration, that's a dot com company if you would like to email
me)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,999
Messages
2,570,243
Members
46,835
Latest member
lila30

Latest Threads

Top