Using server-side headers, the caching of dynamic content-like images and also HTML pages can be avoided. However, this approach is not bulletproof, since some browsers or proxy servers can ignore these settings. A technique that always works is appending a meaningless query string parameter to the URL, as in the following fashion: Math.random() returns a random number between 0 and 1, for instance 0.1296601696732852. Appending this to an image usually does not change the data sent from the server, but it is a completely new request for the browser. Therefore, the image (or other data) is not cached. |