Asset Versioning
The RGS system has a transparent CDN-based cache in place, optimizing asset loading on browsers. This cache is disabled in lower environments for development purposes but enabled in upper environments (stage & prod). When an application is deployed, its assets are automatically purged, so no manual intervention is needed.
It is recommended (and best-practice) to version asset paths/names (e.g., logo1.png to logo1_v1.png) whenever a production asset changes. This approach is valid to avoid cache issues (by not depend on it on a functional level) and provide full backward compatibility in all cases.
While the index.html has a fixed name, all the resources within it (normally packed as a javascript bundle) should be properly versioned/hashed so refreshing the index.html picks up the latest versions independently of the rest of the cache status.
Query-param based cache busting is not supported, so any parameter destined to this end (e.g., ?version=<>) won't have any effect on the cache system. Reasons for this are:
- For this type of cache-busting to work, CDNs must be configured accordingly and it is not always supported.
- When supported by the CDN, it normally is an "all or nothing" approach, which might end with suboptimal cache hits.
- Although negligible in many cases, performance can be negatively affected.
- This type of cache busting moves the CND cache behavior dependency to the end-user, opening new attack vectors.
- Backwards compatibility is not ensured in all cases, which makes it prone to production unexpected bugs.