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
Is your feature request related to a problem? Please describe.
Opening the Plan website from a far away (latency) webserver takes longer to get the required javascript and json files. Some of these could already be cached by the browser.
This can take seconds off the loading time when webserver is on another continent to the user.
Following can be considered cacheable:
React bundle files (The resource files do have a last modified date attached to them, either via assetVersions.yml or from files on disk)
json_cache contents (They have timestamps tied to them)
Notes from the linked article
Use Cache-Control: private header when content is based on cookies
Cache-Control: max-age=seconds can be used to define how long response is valid - longer values could be used for bundles
ETag: <tag> and If-None-Match: <tag> can be used with 304 Not Modified to use the cached version of files. "servers are free to set the value based on whatever means they choose."
Cases where request has no cache stuff in it should also be dealt with (Fresh loads, reloads etc)
"considering the overall HTTP ecosystem, it is preferable to provide both ETag and Last-Modified."
If something is not to be cached use Cache-Control: no-cache, private
For react bundle files, Cache-Control: max-age: 2592000; Last-Modified: ...; Etag: <timestamp> - Caching for a month, causes no issues since bundle files have hash in filenames
For json, Cache-Control: no-cache, private; Last-Modified: ...; Etag: <timestamp> - This should allow returning a 304 until queries finish. Needs to be checked.
The text was updated successfully, but these errors were encountered:
I would like to be able to..
Speed up page loading times on subsequent visits.
Is your feature request related to a problem? Please describe.
Opening the Plan website from a far away (latency) webserver takes longer to get the required javascript and json files. Some of these could already be cached by the browser.
https://developer.mozilla.org/en-US/docs/Web/HTTP/Caching
This can take seconds off the loading time when webserver is on another continent to the user.
Following can be considered cacheable:
Notes from the linked article
Cache-Control: private
header when content is based on cookiesCache-Control: max-age=seconds
can be used to define how long response is valid - longer values could be used for bundlesETag: <tag>
andIf-None-Match: <tag>
can be used with304 Not Modified
to use the cached version of files. "servers are free to set the value based on whatever means they choose."Cache-Control: no-cache, private
Based on this following could be implemented:
Cache-Control: no-cache; Last-Modified: ...; Etag: ...
https://developer.mozilla.org/en-US/docs/Web/HTTP/Caching#main_resourcesCache-Control: max-age: 2592000; Last-Modified: ...; Etag: <timestamp>
- Caching for a month, causes no issues since bundle files have hash in filenamesCache-Control: no-cache, private; Last-Modified: ...; Etag: <timestamp>
- This should allow returning a 304 until queries finish. Needs to be checked.The text was updated successfully, but these errors were encountered: