FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » Imported messages » comp.lang.php » Avoiding Proxy Caching
Show: Today's Messages :: Polls :: Message Navigator
Return to the default flat view Create a new topic Submit Reply
Re: Avoiding Proxy Caching [message #174963 is a reply to message #174957] Wed, 27 July 2011 06:40 Go to previous messageGo to previous message
alvaro.NOSPAMTHANX is currently offline  alvaro.NOSPAMTHANX
Messages: 277
Registered: September 2010
Karma:
Senior Member
El 26/07/2011 17:35, j escribió/wrote:
> I'm having trouble with a proxy server caching pages. Is there a header
> or something that I can send to alleviate this problem?
>
> What I have is an htaccess rewrite rule
>
> RewriteRule ^(.*/protected_directory/.*) /pass_check_script.php?path=/$1
>
> that sends all requests for a directory to a php script that does some
> password checking and then reads the file and prints a Content-type and
> then prints the file contents. A proxy server has cached the results and
> avoids the pass check.
>
> I was thinking of sending something in the header, or perhaps just
> amending some random string to the html. I know proxy servers ignore
> html type no-cache settings.

I normally use something like this:

header('Expires: ' . gmdate('D, d M Y H:i:s', time()-86400*365*10) . '
GMT');
header('Cache-Control: no-store, no-cache, must-revalidate,
post-check=0, pre-check=0');
header('Pragma: no-cache');

If I recall correctly it's the "Pragma" header the one that's designed
for proxies but I'd say there's no need to cache the password checking
page not even in browsers.


--
-- http://alvaro.es - Álvaro G. Vicario - Burgos, Spain
-- Mi sitio sobre programación web: http://borrame.com
-- Mi web de humor satinado: http://www.demogracia.com
--
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: how to make a function recursive
Next Topic: PHP and Flash
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Tue Nov 26 19:46:33 GMT 2024

Total time taken to generate the page: 0.06578 seconds