prismicio-community / php-kit

Community maintained development kit for Prismic and the PHP language
https://prismic.io
Other
109 stars 83 forks source link

Add SearchForm#isCached method #88

Closed tremby closed 9 years ago

tremby commented 9 years ago

This also adds a few related private helper methods which help reduce code duplication.

Rationale: knowing whether a particular query is already cached can change your mind about which queries to perform. For example, if I want to get the first blog entry I could query for all blog entries with a page size of 1. But if I already have a cached result set for 'all blog entries' with a larger page size it is much faster to use that result set and take the first result from it.

This relies on my other pull request, since we need a reliable CacheInterface API for this to be reliable.