I've been doing some work on a friends site and noticed that the pages were loading slowly. The pages are fairly image heavy but are all based on the same template, the images (logos,buttons etc.) being identical on each page.
The images seemed to be being sent from the server when each page was visited rather than reloaded from the browser cache, so I did a little investigating.
I emptied out my temporary internet files folder and loaded the page. Looking at the files in the temporary internet files folder I found that the 'expires' column for all of the files (images,html and everything else) was set to 1 hour before the time in the 'last accesed' column.
Meaning the files will always be called from the server and not the browser cache.
I did some hunting through the code on each of the pages to see if there was anything I could see that may be causing this. There isn't. Whatever is causing this is not caused by the code on the pages themselves.
I loaded a few random pages from another site that I'm working on into a new directory on the probem site. I had exactly the same result. Expiry dates for files set before they were accessed, with the same slow down while waiting for pages to recall all the files from the server.
I've used PHP header functions before to prevent html files from caching, but even when these are used, all images can still be cached.
So to recap, something is causing the 'expire' times to be set before the 'last accessed' times forcing the browser to recall everything from the server, and it has nothing to do with the code on the individual pages being called.
Any ideas?
The images seemed to be being sent from the server when each page was visited rather than reloaded from the browser cache, so I did a little investigating.
I emptied out my temporary internet files folder and loaded the page. Looking at the files in the temporary internet files folder I found that the 'expires' column for all of the files (images,html and everything else) was set to 1 hour before the time in the 'last accesed' column.
Meaning the files will always be called from the server and not the browser cache.
I did some hunting through the code on each of the pages to see if there was anything I could see that may be causing this. There isn't. Whatever is causing this is not caused by the code on the pages themselves.
I loaded a few random pages from another site that I'm working on into a new directory on the probem site. I had exactly the same result. Expiry dates for files set before they were accessed, with the same slow down while waiting for pages to recall all the files from the server.
I've used PHP header functions before to prevent html files from caching, but even when these are used, all images can still be cached.
So to recap, something is causing the 'expire' times to be set before the 'last accessed' times forcing the browser to recall everything from the server, and it has nothing to do with the code on the individual pages being called.
Any ideas?