You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Ronaldo Luiz de Carvalho <ro...@cm5.com.br> on 2015/11/16 21:19:37 UTC

[users@httpd] How to force browsers doesn't use cache

Hi all,

 

I need to force my site users to use the last version of the site php pages.

 

Some site users are getting information from their browsers cache.

 

There are a way to setting apache in a way to force the users site browsers
doesn't use their cache?

 

On all site access the page come from site, never from cache browser
version.

 

Thanks in advance

 

Ronaldo Luiz

 

 


Re: [users@httpd] How to force browsers doesn't use cache

Posted by Christopher Schultz <ch...@christopherschultz.net>.
Pete,

On 11/16/15 3:52 PM, Pete Houston wrote:
> On Mon, Nov 16, 2015 at 06:19:37PM -0200, Ronaldo Luiz de Carvalho wrote:
>> There are a way to setting apache in a way to force the users site browsers
>> doesn't use their cache?
> 
> You can use the Header directive to set the appropriate value of the
> Cache-Control header.
> 
> http://httpd.apache.org/docs/2.4/mod/mod_headers.html#header
> http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.9

+1

Plus the "Pragma" header for ancient clients, if you want.

This is how we do it:

        Header set Cache-Control "no-cache, no-store, must-revalidate"
        Header set Pragma "no-cache"
        Header set Expires 0

Make sure you don't overdo this... if you have .css, .js files, etc.
that *should* be cached, don't let this apply to them.

-chris

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] How to force browsers doesn't use cache

Posted by Pete Houston <ph...@openstrike.co.uk>.
On Mon, Nov 16, 2015 at 06:19:37PM -0200, Ronaldo Luiz de Carvalho wrote:
> There are a way to setting apache in a way to force the users site browsers
> doesn't use their cache?

You can use the Header directive to set the appropriate value of the
Cache-Control header.

http://httpd.apache.org/docs/2.4/mod/mod_headers.html#header
http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.9

Pete
-- 
Openstrike - improving business through open source
http://www.openstrike.co.uk/ or call 01722 770036