FortAwesome / Font-Awesome

The iconic SVG, font, and CSS toolkit
https://fontawesome.com
Other
73.49k stars 12.2k forks source link

Remove query strings from static resources #3286

Closed delight closed 6 years ago

delight commented 10 years ago

Resources with a "?" in the URL are not cached by some proxy caching servers. Remove the query string and encode the parameters into the URL

turn http://iplocator.herokuapp.com/fonts/fontawesome-webfont.woff?v=4.0.3

into http://iplocator.herokuapp.com/fonts/fontawesome-webfont-4.0.3.woff

olegomon commented 10 years ago

+1

It is also difficult to generate appropriate urls for application cache manifest. You cannot simply take file names for the urls to make the cache work properly. You also have to consider the current version with the query string for the urls inside the manifest. Which is not as simple as taking the filenames.

robinwyss commented 10 years ago

+1

LDSign commented 10 years ago

+1

ghost commented 10 years ago

+1

Jojo-Jojovich commented 10 years ago

+1

delight commented 10 years ago

3286 is older then #3823 and #3823 is different!

Also #663 is different - just because it is about the versioning it does not mean that those issues are all the same. Please be cautious about such things.

tagliala commented 10 years ago

@delight are you ok now?

tagliala commented 10 years ago

@delight have you also read why I referred this issue from #663? Could you please read the following comment: https://github.com/FortAwesome/Font-Awesome/issues/663#issuecomment-53957309?

delight commented 10 years ago

I don't get it - what's your point ?

jukkasi commented 10 years ago

+1

Because versioning is using query strings it is impossible to get fontawesome files to get added to HTML5 application cache and ugly workaround is needed

http://stackoverflow.com/questions/24055244/webfont-font-awesome-not-working-corrently-offline

I think the version should be in the file names itself which is the recommended way to do versioning

http://www.stevesouders.com/blog/2008/08/23/revving-filenames-dont-use-querystring/

rrajewski commented 9 years ago

+1

jeromegv commented 9 years ago

+1

ivanjuras commented 9 years ago

+1 from me as well

jordanrynard commented 9 years ago

+1

thielj commented 9 years ago

+1

tagliala commented 9 years ago

Added to 5.0.0 milestone

swbullis commented 9 years ago

As a way to bypass this for Offline Cache you can added a custom style directly after loading the font awesome css library with them removed.

<link rel="stylesheet" href="//maxcdn.bootstrapcdn.com/font-awesome/4.3.0/css/font-awesome.min.css">

<style>
/*Temporary Fix for Font Awesome ApplicatonManifest offline Cache */
@font-face {
     font-family: 'FontAwesome';
     src: url('../fonts/fontawesome-webfont.eot');
     src: url('../fonts/fontawesome-webfont.eot') format('embedded-opentype'),       url('../fonts/fontawesome-webfont.woff2') format('woff2'), url('../fonts/fontawesome-webfont.woff') format('woff'), url('../fonts/fontawesome-webfont.ttf') format('truetype'), url('../fonts/fontawesome-webfont.svg') format('svg');
       font-weight: normal;
       font-style: normal;
}
</style>
vladimirmartsul commented 9 years ago

+1

johnnyshields commented 9 years ago

+1

scotty6435 commented 9 years ago

+1!

mehalick commented 9 years ago

+1

JackMorrissey commented 9 years ago

+1

virgofx commented 9 years ago

+1

virgofx commented 9 years ago

@davegandy Any chance this could get included in 4.4.1?

aadi27 commented 8 years ago

+1

ghost commented 8 years ago

+1

CounsellingHub commented 8 years ago

+1

greggles commented 8 years ago

This seems like a popular common problem and the solution has received a lot of "+1" comments.

Is this blocked on someone doing the work or is it blocked on the belief that this idea is not a good solution?

ziahamza commented 8 years ago

The query string makes it really hard to use font awesome in browser extension. Even a less flag to remove the query string from url would come a long way.

andrenarchy commented 8 years ago

+1 Currently, I have to rename the font files for inclusion in an extension.

robert-claypool commented 8 years ago

+1

I must enable Forward Query Strings in CloudFront only to support Font Awesome.

mriehema commented 8 years ago

+1

blindpet commented 8 years ago

I am struggling to understand why nothing is being done abut this 1 year later.

Another +1

@davegandy is there something we need to do to help move this along?

ralphonz commented 8 years ago

another +1. been an issue for ages

mattbucci commented 8 years ago

+1

cdobbyn commented 8 years ago

+1

psimoneau22 commented 8 years ago

+1

plremis commented 8 years ago

+1

swherdman commented 8 years ago

+1

drzraf commented 8 years ago

Could someone state why these query-string reached the build-process in the first place? (I guess it's about mobile-cache, isn't?) Were common/standard-compliant proxy-cache configurations considered at that time?

Query-string versioning is here to workaround buggy proxies, but shouldn't proxies assumed to behave correctly? People who currently have correct reverse-proxy stack/configuration are the most annoyed ones.

ghost commented 8 years ago

Why is this being left so long to appear in a major milestone, when it could be simply pushed out quickly? I'm just going to edit my CSS file where they're being referenced until the change comes out.

drzraf commented 8 years ago

If people set their CSS/JS/fonts to Expire in 10 years they should just be given what they expect.

mkurz commented 8 years ago

+1

chris-purcell commented 8 years ago

A work around has been posted. As well, if you place the fonts on the server (or in your CDN) you don't have to use the query string at all. You only need the query string when accessing the fonts from fontawesome's servers. No fix is needed on their end. This is an end user comprehension issue.

andrenarchy commented 8 years ago

@chris-purcell the query string is included here so we're all using it by default. The query string confuses caches and breaks browser extensions by default. Of course, we can overwrite @font-face. The purpose of this issue is to fix it upstream so everyone benefits from it.

gerrywastaken commented 8 years ago

This is an end user comprehension issue.

@chris-purcell Wow, in my case you are correct. It seems I had googled for the problem I was having and ended up on a bug report on the wrong repo. My issue was actually with the addition of version strings to font-awesome in a popular Rails gem. Which it seems, was actually an issue that was fixed 27 days ago: https://github.com/bokmann/font-awesome-rails/pull/175

andrenarchy commented 8 years ago

@gerrywastaken this is exactly what we're all doing now. It'd be great to have it fixed upstream.

lt7 commented 8 years ago

+1

juanpablof commented 7 years ago

+1

melroy89 commented 7 years ago

Based on the reference from @rmm5t . FontAwesome needs to take this bugfix along, thus somebody needs to merge this change and it will be fix finally in CDN from Bootstrap.