Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

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

#71

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

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

State: new
Milestone: none
Assigned to: nobody

Activity

  1. Rusty Klophaus
  2. Rusty Klophaus
    Rusty Klophaus
    • Milestone cleared.
    • Milestone order changed from 0 to 0

    June 29th, 2010 @ 08:00 PM

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.