Closed jan-thoma closed 7 years ago
Agreed. Would really like to use this plugin to generate API endpoints, but I'd prefer if it were possible to get the data from cache instead from the database on each request.
Thoughts on implementation? Maybe just a cache
endpoint config setting that you set to a interval spec, and future requests will just use the cached response until the cache expires?
I think that would be great, @brandonkelly! That would cover my main hesitation here.
What would be really great is if a change to one of those entries busted the cache, too. That'd likely add a great deal of complexity so I understand if it isn't in scope for this project.
Haha yeah I’m out of the cache-busting business :)
Ha! I don't blame you guys one bit!
I think allow a simple date mechanism (wipe the cache every X duration) is sufficient for my needs.
Element API 1.5.0 for Craft 2, and 2.3.0 for Craft 3, are out now with a cache
endpoint config option.
This is awesome. Thanks a ton, @brandonkelly!
Adding the possibility to cache the json files would be be great