Caching: Reduce impact of Search Document retrieval
Closed this issue · 0 comments
Background
The server caches certain webservice API requests for Document collections. Documents initially retrieved from the database are cached to reduce the time it takes for pathways in the UI to appear. There are two types of requests for public
Documents associated with the:
- Carousel: 20 most recently submitted public Documents (fast)
- Search: All public Documents (slow)
Issue
On first load, the server is burdened with retrieving Documents and UI can be blocked. Indeed, the relatively rapid request related to the Carousel is impeded by the Search-related request. My iMac 3.6 GHz 8-Core Intel Core i9 responds in 39s and so your mileage may vary depending on the instance (i.e. Digital Ocean certainly less power).
- When is the cached empty?
- On app boot
- On Document submission (i.e. status set to
public
) - Cache expiry: currently the time to live (TTL) is hardcoded to 24 hours
Future
This strategy is, and always was a temporary feature as the size of number of submissions increased. Now we're seeing the strategy buckle under the weight of more participants.
We should discuss plans to implement (or possibly even remove) the search capability as is.