Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.php > #2655

Re: Avoiding Proxy Caching

From "Álvaro G. Vicario" <alvaro.NOSPAMTHANX@demogracia.com.invalid>
Newsgroups comp.lang.php, al.html
Subject Re: Avoiding Proxy Caching
Date 2011-07-27 08:40 +0200
Organization http://alvaro.es/
Message-ID <j0obt1$8mi$1@dont-email.me> (permalink)
References <j0mmsc$gp8$1@news.albasani.net>

Cross-posted to 2 groups.

Show all headers | View raw


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
--

Back to comp.lang.php | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

Avoiding Proxy Caching j <mung_me@att.net> - 2011-07-26 11:35 -0400
  Re: Avoiding Proxy Caching Michael Fesser <netizen@gmx.de> - 2011-07-26 19:58 +0200
    Re: Avoiding Proxy Caching j <mung_me@att.net> - 2011-07-26 15:02 -0400
  Re: Avoiding Proxy Caching "Álvaro G. Vicario" <alvaro.NOSPAMTHANX@demogracia.com.invalid> - 2011-07-27 08:40 +0200
    Re: Avoiding Proxy Caching Michael Fesser <netizen@gmx.de> - 2011-07-28 15:19 +0200

csiph-web