Browser cache is not handled correctly
csansoon opened this issue · 1 comments
csansoon commented
Description
When configuring the TTL in a source or a query, responses will contain a 'Cache-Control' header with this ttl option. In most browsers, this will make it cache the response and not actually send the request to Latitude's server until it has expired.
Main issue
Let's say we have a query with a ttl of 1 day. Requesting this query will return its content and cache the response. If the contents of this query change during the day, requesting the query from the same browser again will not show the updated data, this is expected behaviour. To update it, the user sends a request with the "__force" parameter. This results in two issues:
- First, this request with the __force parameter, although it does show the updated data, will be cached too. This means that running the request with __force again during the rest of the day won't actually send a force request to the server, since it is just a GET request that is cached in the browser.
- Additionally, even if we have sent a force request, the original request is still cached, so running it again will still return the original data from the start.
Goal of Feature
- Do NOT cache forced requests.
- Manage the browser's cache invalidation
Current Solution / Workarounds
The only way to bypass this issue is by disabling browser cache.