I had the opportunity to use my action_cache plugin code in a project today. While adding the code to the project, I realized I could do a little better at caching than I had thought when I wrote the code some time ago.
I handled this case by implementing a custom fragment_key method. Mine now looks something like this:
Now I have different output cached for admin and non-admin users.
The fragment key generation can include any data your actions depend on for different output. My project uses Matt’s Theme Support plugin and multiple sites can use the same theme, so I can actually change my fragment_key method to something like this:
Even I didn’t realize quite how powerful this feature was.
If anyone is using the action_cache plugin, can you leave a comment so I know who you are! Thanks