Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Caching problem 2

Status
Not open for further replies.

Dweezel

Technical User
Feb 12, 2004
428
GB
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?
 
server configuration.

cache control is typically a function of HTTP Headers (although certain aspects can be controlled in the HTML).

Images, although not text, can still have an 'expires' value, which would be set by the server through HTTP headers.

---
Marcus
better questions get better answers - faq581-3339
accessible web design - zioncore.com
 
Thanks guys. Yep it certainly looks like something strange is going on server side. I've been with many remote hosts before and never come across this. Have either of you?

Here's a url anyway:


It's an shtml page but I've found that page extensions and contents are irrelevant. All files have an expiry date set 1 hour before last accessed.
 
If it is a server-side configuration issue, what would be the point of it? The remote host is one of the largest in the UK. Surely by doing this they are massively increasing the amount of bandwidth that their hosted sites use. Or is that the point? :)
 
a sample image - - sets an expiry one hour in the future.

I get the same. A request to the home page gives a 10 minutes cache response.

If it is a server-side configuration issue, what would be the point of it? The remote host is one of the largest in the UK. Surely by doing this they are massively increasing the amount of bandwidth that their hosted sites use. Or is that the point? :)

It's PIPEX, anything is possible. [wink]

Hope this helps

Wullie

Fresh Look - Quality Coldfusion 7/Windows Hosting

The pessimist complains about the wind. The optimist expects it to change. The leader adjusts the sails. - John Maxwell
 
I've found the problem. My computer clock was set to the wrong year [blush]. I set it to the correct year and the files now have an expire time set one hour in advance rather than an hour previous to download.

Thanks for your help guys, and sorry for wasting your time.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top