You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Personally, I think it's more useful to fingerprint all files regardless of their extension and only exclude a few. It would be great if that mode was supported by setting extensions: null.
Here's why:
When I deploy my static assets I basically want them cached forever. That's why I configured my CDN (CloudFlare) to instruct the browsers to cache all files from my https://assets.example.com/ domain for 1 year. The problem with this is, that there are some files (like icon fonts) that don't get fingerprinted because of their file extension, but still get these caching rules.
This is problematic when these files are regenerated and change. Because they were not fingerprinted, all browsers retain the old version and don't download the new one.
Of course I could fix this by adding .woff and all other web font output extensions to the extensions array.
However, this is tedious and paves the way for unexpected caching errors. Especially when I introduce additional formats like .svg or .webm, etc.
Whenever I add a new static file format, I'd have to make sure it's on the list.
Therefore my suggestion: Setting extensions: null disables the filtering. This would not break backwards compatibility as far as I can see. I'd make a PR, if you're okay with this. 😃
One step further (but breaking backwards compatibility): fingerprint all files by default, except for some sensible exclusions, like /index.html and /favicon.ico, even though the latter one is debatable. The old behaviour would be opt-in by setting extensions to an array.
Was there a specific reason to not fingerprint all files right away? Performance maybe? If peformance is a problem, we could introduce a new setting maxSize, and files would be filtered based on that.
The text was updated successfully, but these errors were encountered:
Personally, I think it's more useful to fingerprint all files regardless of their extension and only exclude a few. It would be great if that mode was supported by setting
extensions: null
.Here's why:
When I deploy my static assets I basically want them cached forever. That's why I configured my CDN (CloudFlare) to instruct the browsers to cache all files from my
https://assets.example.com/
domain for 1 year. The problem with this is, that there are some files (like icon fonts) that don't get fingerprinted because of their file extension, but still get these caching rules.This is problematic when these files are regenerated and change. Because they were not fingerprinted, all browsers retain the old version and don't download the new one.
Of course I could fix this by adding
.woff
and all other web font output extensions to theextensions
array.However, this is tedious and paves the way for unexpected caching errors. Especially when I introduce additional formats like
.svg
or.webm
, etc.Whenever I add a new static file format, I'd have to make sure it's on the list.
Therefore my suggestion: Setting
extensions: null
disables the filtering. This would not break backwards compatibility as far as I can see. I'd make a PR, if you're okay with this. 😃One step further (but breaking backwards compatibility): fingerprint all files by default, except for some sensible exclusions, like
/index.html
and/favicon.ico
, even though the latter one is debatable. The old behaviour would be opt-in by settingextensions
to an array.Was there a specific reason to not fingerprint all files right away? Performance maybe? If peformance is a problem, we could introduce a new setting
maxSize
, and files would be filtered based on that.The text was updated successfully, but these errors were encountered: