CondeNast / purgely

A WordPress plugin to manage Fastly caching behavior and purging.
24 stars 9 forks source link

What's the best way to handle not caching logged in views? #5

Closed tollmanz closed 8 years ago

tollmanz commented 8 years ago

Full page caching in WordPress typically caches pages for logged out users only. Logged in users do not get a cached page. An generic Fastly configuration should adhere to this practice.

What is the best way to do this? Should Cache-Control: private be set via the plugin? Should a custom VCL rule be generated? Should the Fastly admin be used to generate a rule?

I tend to think that because this plugin aims to provide as much of the default WordPress caching log as possible, it makes sense to include it in the plugin.

@simonwistow Any thoughts?

tollmanz commented 8 years ago

Doing some more testing of this, I'm seeing that WordPress, by default, issues the following response header for logged in users:

Cache-Control:no-cache, must-revalidate, max-age=0

Given that this is the case, I think the plugin should work well with that and not send the Fastly cache headers for logged in users. This will help ensure that logged in views are not inadvertently cached.

tollmanz commented 8 years ago

Went ahead and created #6. I think this is the right move. If you have objections @simonwistow, let me know and I can change it.