1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

XF 1.4 Remove query strings from static resources

Discussion in 'Troubleshooting and Problems' started by nodle, Aug 9, 2015.

  1. nodle

    nodle Well-Known Member

    So I have been playing with my page speed today. I have got it up there but my number one problem it shows is "Remove query strings from static resources". I have been reading only on how to fix this. I am behind Cloudflare so I thought it may have something to do with that, but after playing around I still can't fix it. Has anyone else successfully been able to fix this with Xenforo, or does someone have an idea of how I could improve them? Thanks for the info!
  2. Oguzhan Malli

    Oguzhan Malli Member

    yep i have problem about Remove query strings from static resources. Can you help me?
    Last edited: Dec 7, 2015
  3. Chris D

    Chris D XenForo Developer Staff Member

    Very easy: nothing to fix or change here :)

    We append the date the avatar was last updated to the avatar URL. This serves as a cache buster, meaning that when the avatar is changed, those changes are reflected instantly instead of the old avatar image showing. Similar thing for javascript.

    They're a necessary evil, but something I would actually say does far more benefit than harm.
  4. Bombardier

    Bombardier Active Member

    The query string on static resources affects my CDN
  5. Chris D

    Chris D XenForo Developer Staff Member

    It actually probably doesn't.

    What is your CDN and what leads you to believe it is affected?
  6. Bombardier

    Bombardier Active Member

    I am using a CDN service provided by my host. I am on a VPS

    They say the following
  7. Chris D

    Chris D XenForo Developer Staff Member

    The query string is essentially indicating the "version" of the file. In the case of avatars it is when the avatar was uploaded. In that sense, it isn't actually dynamically generated and the avatar URL is the same URL consistently until the avatar itself changes, and it's only then the query string part changes.

    I believe some CDN providers are able to handle such things. Browsers are able to handle caching these resources with query strings locally.

    It's an important mechanism which allows us to invalidate caches when it is crucial to do so, such as when JS and CSS change or indeed avatars are changes. Without such a mechanism, these files would change and those changes might not take effect for a considerable amount of time.

Share This Page