You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Some reportings from @tdipisa suggested that something with resources caching may not work as expected.
Expecially was notified that, in some projects, the new update of the TOC was causing issues and needed a cache clean to fix the issue.
Even if not clear how to replicate, @offtherailz did an investigation and identified a possible fail point in the caching system that is consistent with the reporting.
In particular noted that version.txt is sometimes cached by the browser, and this can cause issues with CSS files. No particular findings on JS files instead.
What happens
Most of the files (js and resources) have cache invalidation policy done by an hash at build time, attached to every file. This
One exception is on the main entry point (e.g. mapstore.js that is anyway invalidated by postponing the hash as query parameter. (.e.g .../mapstore.js?abcd1234). This guarantees to follow the same invalidation policy.
The browser anyway caches the text files, even without any indication for caching (e.g. version.txt) - we need to invalidate cache also for this file, and maybe investigate about the policies that made this caching happen.
Anyway an exception can be a probable cause of issue is the URL used to download the main theme CSS file. In this case the caching invalidation policy is applyed by postponing with version name to the CSS URL.
E.g. ...mapstore/dist/themes/default.css?v1.6.5. Maybe the issue with the version.txt cache in the point above can propagate to this file's cache and cause the issue reported.
Proposal:
In this case I'd suggest to use hashes also for version.txt (at least)
Review if other static files have the same issue (e.g. images, static files of other kinds)
Uniform the caching policy of the main theme css with the policy used by js files (with hashes) Note: this file have to be properly identify to allow static theme configuration, so we should call a url like themename.css?hash like for the main JS theme. Using themename-<hash>.css may make impossible to configure it statically (e.g. with datadir multiple client setups).
This should improve also the initial loading time (we don't have to wait to load version.txt to load the theme), decoupling more the general caching strategies from the version text.
Description
Some reportings from @tdipisa suggested that something with resources caching may not work as expected.
Expecially was notified that, in some projects, the new update of the TOC was causing issues and needed a cache clean to fix the issue.
Even if not clear how to replicate, @offtherailz did an investigation and identified a possible fail point in the caching system that is consistent with the reporting.
In particular noted that
version.txt
is sometimes cached by the browser, and this can cause issues with CSS files. No particular findings on JS files instead.What happens
mapstore.js
that is anyway invalidated by postponing the hash as query parameter. (.e.g.../mapstore.js?abcd1234
). This guarantees to follow the same invalidation policy.version.txt
) - we need to invalidate cache also for this file, and maybe investigate about the policies that made this caching happen.E.g.
...mapstore/dist/themes/default.css?v1.6.5
. Maybe the issue with theversion.txt
cache in the point above can propagate to this file's cache and cause the issue reported.Proposal:
version.txt
(at least)Note: this file have to be properly identify to allow static theme configuration, so we should call a url like
themename.css?hash
like for the main JS theme. Usingthemename-<hash>.css
may make impossible to configure it statically (e.g. with datadir multiple client setups).This should improve also the initial loading time (we don't have to wait to load
version.txt
to load the theme), decoupling more the general caching strategies from the version text.Browser info
(use this site: https://www.whatsmybrowser.org/ for non expert users)Other useful information
The text was updated successfully, but these errors were encountered: