jossef / material-design-icons-iconfont

Material Design icons + Development Experience
https://jossef.github.io/material-design-icons-iconfont
Apache License 2.0
455 stars 58 forks source link

Cache busting for the font URL #51

Open stof opened 4 years ago

stof commented 4 years ago

To allow defining a long cache header on the font files, it would be great if the reference in the CSS could provide some kind of cache busting, with a query string parameter updated when you update the font file (the query string parameter could use a hash of the file or a version number, depending of what is easier to you).

stof commented 4 years ago

@jossef any plan to implement this ?

jossef commented 4 years ago

hey @stof great suggestion. any chance you submit a PR?

sorry for the late response

stof commented 4 years ago

I'm not familiar with the way this package is built (I'm only consuming it, bundling the CSS in my project). So I don't know what would be the proper way to implement that cache busting (updating the cache busting param manually when the font is updated is a bad idea IMO, as it is too easy to forget)

stof commented 3 years ago

I see that the build script already computes a hash of some files to detect changes. This might be used as the cache-busting param, if it is possible to inject it into the scss source (probably using a truncated hash only to be shorter).

However, currently, it seems like this hash accounts only for the list of icons, and so would not cache-bust things if a release is only changing existing icons.