0

I notice that in Font Awesome there are version parameters in the CSS file and speed testing tools recommend to remove them from static resources:

@font-face {
  font-family: 'FontAwesome';
  src: url("/vendor/font-awesome/fonts/fontawesome-webfont.eot?v=4.6.3");
  src: url("/vendor/font-awesome/fonts/fontawesome-webfont.eot?#iefix&v=4.6.3")...
  ....
}

What is the function of those parameters? Is it safe to remove everything after (and including) the ? or is there really any reason to keep those parameters?

george
  • 394
  • 1
  • 2
  • 17
  • They prevent caching while the CSS file is under development. – 4castle Mar 14 '17 at 23:15
  • Useful for cache control. – Gabriele Petrioli Mar 14 '17 at 23:15
  • Wow, only that? Is there really any developer who wouldn't consider disabling browser cache and rely on that? – george Mar 14 '17 at 23:16
  • It's not just for the developers, it's also for all the other people who have been to the site before, and have caching enabled. – 4castle Mar 14 '17 at 23:19
  • And what can be the negative effect of removing the parameters? It seems to be counter performance if the resource cannot be cached. – george Mar 14 '17 at 23:20
  • You can remove the parameters if you're certain you'll have access to each and every client browser to disable their cache, almost not possible, but who knows... As you can see, they're even prefixing it with `iefix` for a reason – Morgs Mar 14 '17 at 23:24
  • 1
    @george it is cached as long as the name has `?v=4.6.3`. You only re-download it when that string changes. So when you implement the new version with `?v=4.6.4`, anyone on your site who had the previous version cached will get this new version since the filename changed, and it will be cached until the `?v=4.6.4` changes to something else. If you remove it entirely, and you update from one version to another, some peoples' computers might not get the new version since the filename is the same. – Michael Coker Mar 14 '17 at 23:24
  • Thank you everyone! – george Mar 14 '17 at 23:27

0 Answers0