How does cache plugins like WP Super Cache handly dynamic content?
-
Hi,
I’m curious to know how cache plugins normally handle content. My reason is that I’m thinking about writing a plugin or two which:
- Modify the WordPress loop to sort posts the way I like them to be sorted.
- Maybe something which checks the HTTP referrer and displays “Hey! Welcome <insert social media site> user!” to visitors from certain domains.
For case 1: Maybe I’ll sort the posts using some kind of weight mechanism which favors recent and popular posts. In other words the order of posts to display may change quite often. That however does not mean that I think it’s important to change the served cached content that often. It can very well be cached for a couple of hours like it normally would.
For case 2: There is a limited number of domains it has to recognize. So in theory multiple cached versions (ie postname-reddit, postname-digg, postname-stumpleupon etc) could be stored and the user be served the appropriate cached content. I would guess that in practise this isn’t possible? As the cache is a key-value store, where the key is the post URL and the value it’s cached content? For it to work with my “Hey, welcome…” plugin I guess my plugin would need a way to inform the cache plugin which cached version to use. In that case the key would have to be split into two parts {URL, versionid} and that might be more elaborate than what exists today?
I hope someone (preferably cache plugin authors, or at least people who know how these plugins work with WordPress) could shed some light on this. Thank you for taking the time to read my post! ??
- The topic ‘How does cache plugins like WP Super Cache handly dynamic content?’ is closed to new replies.