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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

to allow cache or not - 3

Status
Not open for further replies.

mrmtek

Programmer
Oct 13, 2002
109
AU
by using the following on my php pages, I can stop people from cache my site :

<?php
header("Cache-Control: private");
header("Pragma: no-cache");
?>

what are the full ramifications of doing this , for search engines etc...
 
I think you want to cache... I can not imagine any search engine ramifications but there will be performance ramifications as users will need to totally reload these pages each time they hit them...

[conehead]
 
And that would be seriously irritating especially for those still on a dial-up connection - and they might just get so frustrated that they go away......

What benefits do you envisage in not allowing caching?

Regards, Andy.
**************************************
My pathetic attempts at learning HTML can be laughed at here:
 
Plus the fact is that even with all the meta tags and http header stuff, caching can still occur.

Only try and stop caching on pages that are constantly changing, that's my philosiphy.
 
thank you all - yes some of my pages carry live data feeds and are updated daily - so some would need to be effected - thank you to all.........
 
A common browser setting is to cache pages during a single session. So if I visit one of your pages, then go somewhere else, then come back, I'll read your page from the cache on the second occaision. If I close down my browser, the next time I open it and come to your page, it'll check for a fresh copy.

So assuming that most people don't leave their browsers/PCs on overnight, a daily changing page is no reason to muck about with the caching. Of course, it may be an issue if you're serving customers world-wide - since their nights come at different times. If it's really critical, you should investigate the cache control headers available to you - here's a tutorial. In your case, maybe you should send an [tt]Expires:[/tt] header to make sure each page only caches until the end of the day.

-- Chris Hunt
Webmaster & Tragedian
Extra Connections Ltd
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top