On Nov 13, 2004, at 3:21 AM, Patrick Atoon wrote:
However, when I log in, the logged in version of the
page gets
cached by my browser, leading to strange effects when logging out.
Returning to the page will display the logged in version even though
I'm not logged in. Refreshing the page in the browser fixes the
problem. I have checked with a second browser; squid is not caching
the logged in version of pages.
This sounds normal; in fact you should see the same behavior without
using Squid.
When you log in, you get a login session cookie, so Squid doesn't give
you the public no-cookie pages. Also all pages you visit are now marked
by the wiki as for private caching only, so squid won't mess with them.
Your per-user cache-invalidation timestamp is also updated at login, to
ensure that any pages you had visited prior to logging in get
rerendered for you in the logged-in state.
(When fetching a previously cached page, the browser sends an
If-Modified-Since header with the timestamp of when it last loaded the
page. The wiki checks this given timestamp against a wiki-wide cache
epoch, the current user's user_touched timestamp [updated on login and
preference change], and the page's cur_touched timestamp [updated on
edit, change of existence state of linked pages, and edit of
used/linked templates]. If any of those are more recent than the time
given, the page is re-rendered. If they're all older, a 304 Not
Modified response is sent and the browser shows its cached copy.)
When you log out, the wiki just changes your session data to remove the
login info. You still have a session cookie, but since you're no longer
attached to a user account you don't have a per-user cache invalidation
timestamp. Thus the wiki doesn't know that the pages you visited before
logging out perhaps should be re-rendered in the logged-out state; it
tells your browser that the page hasn't changed (since it hasn't been
edited) and the locally cached copy is shown.
It might be possible to stick a cache invalidation timestamp into the
session on logout, but I'm not sure how consistently this would work.
-- brion vibber (brion @
pobox.com)