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

Feature Request: Add cache busting to webfonts #16375

Closed
dpeekstok opened this issue Mar 27, 2020 · 3 comments
Closed

Feature Request: Add cache busting to webfonts #16375

dpeekstok opened this issue Mar 27, 2020 · 3 comments

Comments

@dpeekstok
Copy link

Is your feature request related to a problem? Please describe.
I recently upgraded to FontAwesome 5.13 and when I did, users were getting caching issues. The main css file, all.min.css, was up to date but the urls to the font files were still the same so browsers didn't update the fonts. Thus, instead of displaying the icons, users were seeing Asian characters.

Describe the solution you'd like
In each of the css files provided by FontAwesome, when making url() calls to the font files, the current FontAwesome version could be appended to the url. This change would be enough to force a browser to load the new version.

E.g.
url("../webfonts/fa-brands-400.eot")
would become
url("../webfonts/fa-brands-400.eot?v=5.13.0")

Describe alternatives you've considered
Appending other cache busting techniques would also work, such as a using a file hash.

Additional context
These are the icons that users were seeing
image

Feature request checklist

  • [ X ] This is a single feature (i.e. not a re-write of all of Font Awesome)
  • [ X ] The title starts with "Feature request: " and is followed by a clear feature name (Ex: Feature request: moar cowbell)
  • [ X ] I have searched for existing issues and to the best of my knowledge this is not a duplicate
@tagliala
Copy link
Member

Hi!

Thanks for being part of the Font Awesome Community.

Could you please clarify if you are using the CDN or your own server?

@dpeekstok
Copy link
Author

The files are locally hosted on our own server

@tagliala
Copy link
Member

tagliala commented Mar 27, 2020

Ok, thanks.

We have deliberately removed version strings from font files some years ago to avoid caching issues (ref: #3286).

If you are serving Font Awesome files from your own servers, please use one of the following approach:

  • Customize the CSS
  • Fingerprint assets
  • Scope the font files inside a folder with version name (as we do in the CDN)

Hope it helps

Closing here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants