Help - Search - Members - Calendar
Full Version: JavaScript & Image Cache
Invision Power Services > Community Forums > Community Web Design and Coding
Luke
I wrote a simple signature feature for my community... It allows you to pick which items you want on your signature and move each item by x and y.

For performance sake I'm having it send the new information, and rebuild the image, through an Ajax request. After the Ajax request is completed, it reloads the image via javascript. The problem is the browser is loading the image that was last cache'd instead of the new image. I would like it to load the new image... Also, I cant change the headers of the page as I dont want it effecting the rest of the site.

Any ideas?
Phil Mossop
Is the image saved to disk or is it sent dynamically using PHP? If it's sent dynamically, you could try using IPB's solution to the problem which is affixing a random variable and value to the URL so it looks like a different address to the last image's but really it's not.

So, if your image to the URL was this:

CODE
getimage.php?x=122&y=55


You'd alter it to this and have javascript create a random key each time it loads the image. The random key isn't used by the script, it just looks like a different URL so the browser fetches the content.

CODE
getimage.php?x=122&y=55&randomkey=17453
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2009 Invision Power Services, Inc.