- First commit to issue fork.
- Merge request !163285651-add-option-to-cache: Added option to cache result data. โ (Merged) created by souvik_banerjee
- ๐ฎ๐ณIndia souvik_banerjee
Hi, I have added code to cache the results stored in table.
- Status changed to Needs review
about 1 year ago 10:51am 25 September 2023 - ๐บ๐ธUnited States themarkahrens
mytungsten โ made their first commit to this issueโs fork.
- ๐บ๐ธUnited States cskeers
As is, the code
$cache_key = 'search_results:' . md5(serialize($results)); if ($cache = $this->cacheManager->get($cache_key)) { return $cache->data; }
caches the full results set as part of the key, meaning the entire search process needs to run prior to fetching this cached data.
The cache check/retrieval/set should likely surround the call to search_fields in searchButton and be keyed to the search parameters in order to bypass the full search process if cached data is present.
Additionally, we'll need to at least have a configurable option to cache or not, and ideally, options to set number of cached entries and/or cache duration. These latter can be incremental improvements, but there needs to be the option to disable caching at the least.
- First commit to issue fork.
- ๐ฎ๐ณIndia manish-31
Hi @cskeers,
I have done the required changes please review and provide feedback to let me know if we need to improve the approach.
Please find the changes/implementation below -
- Added an option to enable/disable caching from settings form.
- Added an option to set cache duration (in seconds), visible only when cache enable checkbox is checked.
- Added a new checkbox field in the Search Form "Invalidate cache", if checked it will invalidate search results cache first and perform new search. Visible only if caching is enabled.
- ๐บ๐ธUnited States themarkahrens
This is now on the 1.x develop release for folks to start reviewing.
- Status changed to RTBC
7 months ago 11:31am 6 June 2024 - gaurav gupta Jaipur, Rajasthsan
Hello @mytungsten @manish-31
I have reviewed the MR and it is working as expected.
When enabling invalidate cache it is taking more time in comparison to when disable it. - Status changed to Fixed
4 months ago 6:00pm 6 August 2024 Automatically closed - issue fixed for 2 weeks with no activity.