Two recent sites I’ve built have plugins built to handle filtering through projects based on some categories and related entries.
For example the lookups look similar to this:
# Get element criterea for searching projects $projectCriterea = craft()->elements->getCriteria(ElementType::Entry); $projectCriterea->section = 'projects'; $projectCriterea->limit = null; $projectCriterea->relatedTo = $relatedElements; # This is an array of categories and related entries. $projects = $projectCriterea->find();
All these lookups aren’t particularly fast, and there aren’t that many different variants. Is there a way I can add some caching into these lookups?
I had a bit of a look into the CacheService but I'm not sure how to apply that to this.