Caching: Force fresh content for logged-in users (potentially by adding a query variable to the URL)

Since you already have the “Don’t cache pages for logged in users” option activated, what about selecting cache with validation under Cache Control Policy for “HTML” content?

Explanation: Essentially, the “don’t cache pages for logged in users” option should already be sending a no-cache header for your logged users only.

If a user has a cached page in its browser (as a non-logged user) and then tries to access the same page when logged in, the cache with validation option inside your “Cache Control Policy” setting for HTML contents should be sending the must-revalidate tag.

Hence, a logged in user would send no-cache,must-revalidate, always requesting a fresh page.

This is pretty much what @gmazzap explained with headers – but from a W3 Total Cache configuration perspective.

Leave a Comment