We use cookies to improve your experience. No personal information is gathered and we don't serve ads. Cookies Policy.

ExpressionEngine Logo ExpressionEngine
Features Pricing Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University
Log In or Sign Up
Log In Sign Up
ExpressionEngine Logo
Features Pro new Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University Blog
  • Home
  • Forums

Hook for clearing cache?

Development and Programming

Kyle Slattery's avatar
Kyle Slattery
109 posts
17 years ago
Kyle Slattery's avatar Kyle Slattery

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 Slattery's avatar
Kyle Slattery
109 posts
17 years ago
Kyle Slattery's avatar Kyle Slattery

Anyone have any ideas?

       
Jamie Poitra's avatar
Jamie Poitra
409 posts
17 years ago
Jamie Poitra's avatar Jamie Poitra

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

       
Kyle Slattery's avatar
Kyle Slattery
109 posts
17 years ago
Kyle Slattery's avatar Kyle Slattery

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?

       
Jamie Poitra's avatar
Jamie Poitra
409 posts
17 years ago
Jamie Poitra's avatar Jamie Poitra

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

       
Kyle Slattery's avatar
Kyle Slattery
109 posts
17 years ago
Kyle Slattery's avatar Kyle Slattery

Yeah, I figured I’d probably end up just going with those, but wanted to see if there was a better one 😊.

Thanks!

       

Reply

Sign In To Reply

ExpressionEngine Home Features Pro Contact Version Support
Learn Docs University Forums
Resources Support Add-Ons Partners Blog
Privacy Terms Trademark Use License

Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.