Hi all,
I’m implementing a bit more heavy-duty approach to caching on my EE site, and I need some way to clear it when a user has submitted something new, changed a template, etc. I know I could just use the hooks for all of these, but what would be best is if I could just piggyback of EE’s default behavior for clearing its own cache rather than picking and choosing all of the individual events.
Any ideas/suggestions on how to proceed?
Thanks!
-Kyle
Kyle,
Not quite sure what you are asking. We don’t have any hooks that I know of that involve caching. And unless I’m mistaken I don’t believe there is a Cache class anywhere. Rather the caching code is built into the template and database classes respectively.
What do you mean by a more heavy duty approach to caching? EE already allows you to cache things ridiculous amounts (though it would be inadvisable to it).
Jamie
I’ve created a new caching mechanism where the entire generated page is cached, so that the database doesn’t get called at all unless the cache needs to be refreshed. Right now, I’m manually clearing the cache, but I’d like to hook it into EE if possible so it’s auto cleared when a new entry is posted, etc.
Does that make sense?
I get you Kyle,
I would just use the appropriate hooks for the actions you need to have trigger the cache clearing. EE clears caches on changing a template and adding/editing an entry. I’m trying to think if there are other instances but I believe you have hooks for both of those at your disposal and there is nothing wrong with doing it that way.
Jamie
Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.