Include version number when fetching static resources to force refresh after upgrade #5818

Closed
opened 2025-12-29 19:33:05 +01:00 by adam · 0 comments
Owner

Originally created by @jeremystretch on GitHub (Dec 21, 2021).

Proposed Changes

Append the current version number to requests for static resources (i.e. Javascript, CSS, etc.) in the UI. For example:

<script type="text/javascript" src="/static/netbox.js?v=3.1.2"></script>

Justification

Appending the version number has no bearing on the response, but it forces the browser to ignore any previously cached version of the file from an older NetBox version. This ensures that clients automatically fetch an updated version of all static assets after upgrading. (These assets are then safely cached until the next upgrade.)

Originally created by @jeremystretch on GitHub (Dec 21, 2021). ### Proposed Changes Append the current version number to requests for static resources (i.e. Javascript, CSS, etc.) in the UI. For example: ``` <script type="text/javascript" src="/static/netbox.js?v=3.1.2"></script> ``` ### Justification Appending the version number has no bearing on the response, but it forces the browser to ignore any previously cached version of the file from an older NetBox version. This ensures that clients automatically fetch an updated version of all static assets after upgrading. (These assets are then safely cached until the next upgrade.)
adam added the status: acceptedtype: housekeeping labels 2025-12-29 19:33:05 +01:00
adam closed this issue 2025-12-29 19:33:05 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#5818