#71 new
Rusty Klophaus

Set content expires in the future on restricted page in Nitrogen Quickstart

Reported by Rusty Klophaus | May 30th, 2010 @ 05:42 PM

hi,
on the page DEMOS / SECURITY,
after logging in, I can see the RESTRICTED PAGE; then I log out.
the issue here is, if I press on the back button on the browser, I
still can see the restricted page (till the next refresh).
how can I solve this in an elegant way? should I use the
reload_on_back_button nitrogen element or is there other solution?


You should prevent client side caching of the served pages.
For this it is best to set both the Cache-Control header and the Expires header:

Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0 Expires: Sat, 15 May 2010 18:11:06 GMT

Be sure that the expiration date is in the past, preferably by a good margin.
In Zotonic we use:

wrq:set_resp_header("Expires", httpd_util:rfc1123_date({{2008,12,10}, {15,30,0}}), RD1),

Comments and changes to this ticket

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.

New-ticket Create new ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

Nitrogen Web Framework for Erlang

People watching this ticket

Pages