Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mention to update cache buster parameter when updating the Matomo font #740

Merged
merged 1 commit into from
Jul 19, 2023

Conversation

bx80
Copy link
Contributor

@bx80 bx80 commented Jun 28, 2023

Description:

This PR updates the Matomo font guide with an additional step to update the cache buster values in the icon font URLs to help invalidate browser font caching.

Review

* Update [plugins/Morpheus/stylesheets/base/icons.css](https://github.com/matomo-org/matomo/blob/5.x-dev/plugins/Morpheus/stylesheets/base/icons.css) and add a new CSS class for this font. The style content in this class needs to mention the font, for example `\e609`. You find the correct value for this from the `style.css` file of the extracted zip file. Simply search for the icon name there to find the correct value.
* Update [plugins/Morpheus/stylesheets/base/icons.css](https://github.com/matomo-org/matomo/blob/5.x-dev/plugins/Morpheus/stylesheets/base/icons.css)
* Add a new CSS class for this icon. The style content in this class needs to mention the font character, for example `\e609`. You can find the correct value for this from the `style.css` file of the extracted zip file. Simply search for the icon name there to find the correct value.
* Update cachebuster parameter of the four font URLs at the top of the file, for example `url('plugins/Morpheus/fonts/matomo.woff2?rzeu9j')` could become `url('plugins/Morpheus/fonts/matomo.woff2?gt43xz')`. The cache buster string can be any six digit random alphanumeric string as long as it's different from the previous one. Providing a new cache buster value will invalidate any old versions of the font in browser caches and force the new font to be used.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've seen cases when the URL query param didn't invalidate for everyone all the time, there might be some obscure proxies etc, but it does work most of the time. The safest way would be to rename the file each time to have the cache-buster param as a part of the actual filename, but that would be a bit too much I reckon.

@sgiehl sgiehl merged commit a085a30 into live Jul 19, 2023
@sgiehl sgiehl deleted the font-cachebuster branch July 19, 2023 06:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants