You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@airavata.apache.org by "Marcus Christie (Jira)" <ji...@apache.org> on 2022/05/23 19:57:00 UTC

[jira] [Updated] (AIRAVATA-3622) Configure browser to revalidate cached static files when they don't have hashes in filename

     [ https://issues.apache.org/jira/browse/AIRAVATA-3622?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Marcus Christie updated AIRAVATA-3622:
--------------------------------------
    Description: 
Most Airavata Django Portal CSS and JS resources that are bundled are written to files that include a hash of the file's contents. For example, the create-experiment entry point may be written to a file named {{create-experiment.d239a691.js}}. This works well for busting browser caches and ensuring that clients always get up to date static files.

However, some CSS and JS resources don't have a hash in their filename. By default these are typically getting cached by browser using freshness heuristics. But these files could be updated at any time. It would be better to use the Cache-Control header for these resources to let browsers know that they must revalidate these cached files with an ETag or Last-Modified timestamp.

For hashed static filenames, we can also instruct browsers to cache those files "forever" since we are guaranteeing that an update to their contents will result in a new filename/URL. That should provide a small performance improvement by cutting down on unnecessary requests for immutable resources.


  was:
Most Airavata Django Portal CSS and JS resources that are bundled are written to files that include a hash of the file's contents. For example, the create-experiment entry point may be written to a file named `create-experiment.d239a691.js`. This works well for busting browser caches and ensuring that clients always get up to date static files.

However, some CSS and JS resources don't have a hash in their filename. By default these are typically getting cached by browser using freshness heuristics. But these files could be updated at any time. It would be better to use the Cache-Control header for these resources to let browsers know that they must revalidate these cached files with an ETag or Last-Modified timestamp.

For hashed static filenames, we can also instruct browsers to cache those files "forever" since we are guaranteeing that an update to their contents will result in a new filename/URL. That should provide a small performance improvement by cutting down on unnecessary requests for immutable resources.


> Configure browser to revalidate cached static files when they don't have hashes in filename
> -------------------------------------------------------------------------------------------
>
>                 Key: AIRAVATA-3622
>                 URL: https://issues.apache.org/jira/browse/AIRAVATA-3622
>             Project: Airavata
>          Issue Type: Improvement
>          Components: Django Portal
>            Reporter: Marcus Christie
>            Assignee: Marcus Christie
>            Priority: Major
>
> Most Airavata Django Portal CSS and JS resources that are bundled are written to files that include a hash of the file's contents. For example, the create-experiment entry point may be written to a file named {{create-experiment.d239a691.js}}. This works well for busting browser caches and ensuring that clients always get up to date static files.
> However, some CSS and JS resources don't have a hash in their filename. By default these are typically getting cached by browser using freshness heuristics. But these files could be updated at any time. It would be better to use the Cache-Control header for these resources to let browsers know that they must revalidate these cached files with an ETag or Last-Modified timestamp.
> For hashed static filenames, we can also instruct browsers to cache those files "forever" since we are guaranteeing that an update to their contents will result in a new filename/URL. That should provide a small performance improvement by cutting down on unnecessary requests for immutable resources.



--
This message was sent by Atlassian Jira
(v8.20.7#820007)