Skip to content

Conversation

msherman64
Copy link
Contributor

when horizon starts up, it compresses angular template fragments for later speedups, and these compressed templates are later stored in the django cache, and also in browser caches.

When the cache expires (default of 30d), the django cache is cleared, and a new cache generated. The cache url is based on the hash of the contents, and so a new url will be generated at this point if the content has changed, causing clients to pull it instead of using their browser cache.

To work around serving stale data during upgrades/patches, we set this expiry to 1d (down from 30). Really, we should be ensuring that horizon re-compresses (and re-hashes) the templates before restarting, which should accomplish the same result.

Details of operation are in:
openstack/horizon@fca46ab

when horizon starts up, it compresses angular template fragments for
later speedups, and these compressed templates are later stored in
the django cache, and also in browser caches.

When the cache expires (default of 30d), the django cache is cleared,
and a new cache generated. The cache url is based on the hash of the
contents, and so a new url will be generated at this point if the
content has changed, causing clients to pull it instead of using their
browser cache.

To work around serving stale data during upgrades/patches, we set this
expiry to 1d (down from 30). Really, we should be ensuring that horizon
re-compresses (and re-hashes) the templates before restarting, which
should accomplish the same result.

Details of operation are in:
openstack/horizon@fca46ab
@msherman64
Copy link
Contributor Author

edit: this turns out to be helpful, but not actually the fix! horizon cache is regenerated if hash of config file changes.

@msherman64
Copy link
Contributor Author

Closing this, as we discovered that it's not actually responsible for regenerating the cache in our common cases.

@msherman64 msherman64 closed this May 6, 2025
@msherman64 msherman64 deleted the fix/horizon_ng_cache branch May 22, 2025 14:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants