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

Using EE’s cache methods

Development and Programming

Paul Bell's avatar
Paul Bell
103 posts
16 years ago
Paul Bell's avatar Paul Bell

Hello,

I wonder if there’s an easy way to cache a query result in a plugin I’ve written? It goes to another website to check an API, so I would like to have a way of caching this result, so that it only checks every 10 mins or so.

I’ve been looking at the Magpie plugin, which has some caching built in, but I wondered if there’s a way of harnessing EE’s built in ability to cache things?

This is different from the $SESS->cache setup, which, of course, only caches things on a particular page load.

Any pointers gratefully received.

Moved to Plugins: Technical Assistance by Moderator

       
Sue Crocker's avatar
Sue Crocker
26,054 posts
16 years ago
Sue Crocker's avatar Sue Crocker

Hi, Paul. This is more of a programming question, so I’m going to move it for you.

       
Pascal Kriete's avatar
Pascal Kriete
2,589 posts
16 years ago
Pascal Kriete's avatar Pascal Kriete

There is no conveniently abstracted way to do this, but there are a bunch of plugins out there that already do this. Take a look at the _check_cache and _write_cache methods in this file. They should be pretty easily modified to fit your needs.

       
Paul Bell's avatar
Paul Bell
103 posts
16 years ago
Paul Bell's avatar Paul Bell

Thanks Sue for putting this in the right place, and Pascal for the heads up. Looks perfect.

       

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.