![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
Hello, How can I cache the images used on a web site design. Some of them are used in CSS others in the HTML. I got this suggestion when testing a web site with Firebug. |
#3
| |||
| |||
|
|
Hello, How can I cache the images used on a web site design. Some of them are used in CSS others in the HTML. I got this suggestion when testing a web site with Firebug. |
#4
| |||
| |||
|
|
Don't browsers usually cache images by default? |
#5
| |||
| |||
|
|
How can I cache the images used on a web site design. Some of them are used in CSS others in the HTML. |
#6
| |||
| |||
|
|
Harlan Messinger wrote: Don't browsers usually cache images by default? Yes, unless the URL contains a "?" (which usually means that the image is being served by some process which extracts it from something other than a simple file). |
|
This behaviour used to really annoy me on map websites, because my browser was downloading the map segments on every reference. In the end I wrote a kind of "Smart proxy" to cache such images regardless. The maps are now much quicker, but you have to be on the lookout for missing recent features, such as new roads. (I set my cache timeout to one year) |
#7
| |||
| |||
|
|
The downside is the browser fetches the images fresh each time. How did you set up your smart proxy, if you don't mind telling? Or is this specific to your local machine? |
#8
| |||
| |||
|
|
Harlan Messinger wrote: Don't browsers usually cache images by default? Yes, unless the URL contains a "?" (which usually means that the image is being served by some process which extracts it from something other than a simple file). |
#9
| |||
| |||
|
|
Swifty wrote: Harlan Messinger wrote: Don't browsers usually cache images by default? Yes, unless the URL contains a "?" (which usually means that the image is being served by some process which extracts it from something other than a simple file). Not so. Browser will cache regardless of the URL, it is the cache control on the server that counts. |
|
Example here is an image from my browser cache showing an image servered via a php script that I use on my server as counter image Key: http://www.littleworksstudio.com/ebay/cms/bc.php?harr0002 Data size: 1709 bytes Fetch count: 2 Last modified: 2009-07-10 18:39:11 Expires: 1969-12-31 19:00:00 |
#10
| |||
| |||
|
|
Jonathan N. Little wrote: Swifty wrote: Harlan Messinger wrote: Don't browsers usually cache images by default? Yes, unless the URL contains a "?" (which usually means that the image is being served by some process which extracts it from something other than a simple file). Not so. Browser will cache regardless of the URL, it is the cache control on the server that counts. What *server* cache control? |
|
My experience is exactly as Swifty mentions, the browser will not cache unless there is a query string. Browser settings can alter that, as well as altering the server image header. But the normal is to cache unless a querystring, that's what I see. |
|
Example here is an image from my browser cache showing an image servered via a php script that I use on my server as counter image Key: http://www.littleworksstudio.com/ebay/cms/bc.php?harr0002 Data size: 1709 bytes Fetch count: 2 Last modified: 2009-07-10 18:39:11 Expires: 1969-12-31 19:00:00 |
![]() |
| Thread Tools | |
| Display Modes | |
| |