isIndexInSync will always result in a cache miss if index is not in sync
Closed this issue · 1 comments
aloco commented
Hi,
I have an installation maintaining around 60K entries.
I noticed slow response times in CP and figured out that
craft-elasticsearch/src/services/ElasticsearchService.php
Lines 86 to 127 in 33782a3
causes SELECT COUNT(*) queries on every CP request which are slow. (>1 second with 60K entries)
Since you are using a boolean as cached value, getOrSet
will always lead to a cache miss, as soon as false
is getting cached which will trigger slow queries on every CP request making working with the dashboard very frustrating. You could use a string instead of a boolean to mitigate that problem.