You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Ali Nebi <an...@iguanait.com> on 2008/05/23 20:59:08 UTC

[users@httpd] How to use mod_expire and how to tell on user browser that content is changed.

Hi, 

i would like to use mod_expire in our site, but what i'm trying to
understand and lear is, how to tell user browser that cached content is
already changed and to cache the new one.

For example if i have set expire time to be this way "access 2 weeks",
but content is changed before this time, this mean that user will not
able to see the new content, because expire time. Is there some way to
tell user browser that this content is changed and to cache the new one?

The reason for this is that we are making some changes time to time and
it will be good if there is somehow to tell the browser for this. We
really need to implement this in our system, because it will reduce
system loading and will increase site performance from user side.

Please give me more info about this. I read some tutorials for
mod_expire from apache site and other internet blogs, but i can't
understand how to do this job with informing browsers for changed
content.

Thanks in advanced!


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


RE: [users@httpd] How to use mod_expire and how to tell on user browser that contentis changed.

Posted by David Dyer-Bennet <Da...@pinerivercapital.com>.
 

> Ali Nebi [mailto:anebi@iguanait.com] said,

> For example if i have set expire time to be this way "access 2 weeks",
> but content is changed before this time, this mean that user will not
> able to see the new content, because expire time. Is there some way to
> tell user browser that this content is changed and to cache 
> the new one?

Won't work; the user's cache contains what you told it, and the browser
won't query for the updated content if the cache "knows" it's valid. 

Generally, setting valid dates into the future can cause you a lot of
problems.  It might work okay for a monthly newsletter most of the time
-- until an incorrect one is posted and you need to issue a quick
update, anyway. 

Not sure what stage you're at, and it may be too late for really much of
anything to help you.  But just in case, there are some other
approaches.

One is to have your site respond to "if-modified-since" headers in GET
requests.  This lets your site decide, on each touch, whether to send
new content or not.  (This can get tricky for scripts, they have to
figure out what modified date to set based on all their sources of
input).  Note that this won't help with long-expire caches alread in
users' browsers, though; you have to wait for those to expire.  But if
you don't set any valid dates into the future, the browsers will query
you for updates and often you can respond "not changed" and save the
time and bandwidth of sending the whole page. 

Another hack that can help in an emergency is to change the name of the
resource; then the cached copy won't relate to the new copy.  Of course
this doesn't work for the top-level index file :-).  Also, it can be a
problem to rename too many of the items on your site. 

--- 

The contents of this message and its attachments, if any, are meant for the sole use of the intended recipient and may be confidential, privileged, or otherwise protected from disclosure. If you are not the intended recipient of this message or have received this message in error, please delete it, immediately alert the sender by reply e-mail, and do not read, disclose, distribute, or otherwise use the information contained herein. If this message was misdirected, neither Pine River nor its affiliates waives any confidentiality or privilege. Pine River retains and monitors e-mail communications sent through its network. This e-mail does not constitute or form part of any offer or invitation to sell, or the solicitation of an offer to purchase any investment and is provided for information purposes only. Pine River believes that the information it provides is accurate and complete as at the date of publication, but does not grant any warranty of such and neither Pine River nor its affiliates accepts any liability in respect of errors or omissions. Past performance is not necessarily a guide to future results.

--- 



---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org