Not Caching Pages if User is Logged In

I have an older web forms site which I would like to speed up using Cloudflare’s CDN/DNS/Cache service, but I am not sure if it would be a good fit because if a user is logged in the content of the page is different. When users are logged in their user name is visible and forms to post content are available so that users can comment on other peoples posts. If Cloudflare caches and servs logged in versions of pages that would be a problem.

I’ve already used Cloudflare on some Wordpress sites and I had to setup special page rules to keep Cloudflare from caching login sections (ex: /wp-admin/) but this is different because I want Cloudflare to cache every non-members only page on the site, but I don’t want it to be cached if the user is logged in and I don’t want logged in users to be served cached copies of pages from when a user was not logged in. I just want to use caching to serve non-logged in users non-logged in copies of pages.

That’s one of the big reasons Cloudflare doesn’t cache HTML by default. Business and Enterprise plans have a Page Rule that lets you Bypass Cache on Cookie, which prevents the situation you describe. This is what APO does behind the scenes for WordPress.

To sum up, by default, Cloudflare will work with that forms site and not cause problems for logged in users.

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.