I have a form that searches via AJAX against two different data sources. The data is relatively small but the speed at which it returns is slow.
I built a cache layer to store the full result after the first query... however, I would like to prime the cache with data before the user executes the search.
Should I be looking at an AsyncController to do this? Any recommendations?
My desired behavior is (updated):
- User requests any ActionABC of some controller (not necessarily the search action)
- Server-side, that action checks the cache and asynchronously requests data if empty
- ActionABC returns requested view while cache continues to populate on server
- If the user subsequently performs a search while cache being populated, their request waits until cache populate is complete otherwise cache data is immediately available