No announcement yet.

Resources with a "?" in the URL - giving me a "c" rating

  • Filter
  • Time
  • Show
Clear All
new posts

  • Resources with a "?" in the URL - giving me a "c" rating

    Ran a test on the site using Pindom speed. Receive the following "C" rating with statement "Remove query strings from static resources". All of them are from common-html5. Can this be fixed? example:

  • #2
    More info: Two of the seven are from the gearhead-html5 template. Five of them are from the common-html5 template.


    • #3
      Thanks for you inquiry! We can definitely look into this issue with those themes. If possible can you submit a support ticket with these details? This way we can look into it soon as possible. Thanks again!


      • #4
        Thanks! I just placed the ticket and sent a screen capture.


        • #5
          3Dcart has responded:
          "Currently, those scripts referenced are set up that way by design. They are done that way so that those pages do not cache. In order to request changes to those you will need to submit a feature request ( Or I can have a sales account manager contact you to provide a custom quote to have those scripts encoded the way you are requesting."


          • #6
            Originally posted by Davef View Post
            3Dcart has responded:
            "They are done that way so that those pages do not cache."
            Unfortunately they are wrong here, these files certainly get cached, and it's easy to verify (go make a change to your css or javascript files, then open it's URL in your browser, you'll have to do a CTRL+F5 to see your changes).

            What does happen, however, is when 3dCart updates the store software from say, version 7.4.0 -> 7.4.1, the url parameter gets updated from ?vcart=7.4.0 -> ?vcart=7.4.1, which browsers will see as a new version of the file and request it again - bypassing cache.

            However, that only occurs when 3dCart updates software, which is not very frequent (~once a month or so).

            The downside to 3dCart injecting these url parameters is that you cannot override them or set them yourself - ie. when you need a javascript or css file to be picked-up immediately by browsers after you've changed something. The only work-around for now is to completely change the name of the file, which accomplishes the same thing but pollutes your templates with unnecessary changes.

            We ran into this issue during Black Friday, attempting to get return visitors' browsers to pickup our new themed CSS for that weekend. Flushing the cache on the server is not enough, since browsers are very "sticky" now-days and are reluctant to purge files from their cache in the name of performance.


            • #7
              Originally posted by Alupis View Post

              However, that only occurs when 3dCart updates software, which is not very frequent (~once a month or so).
              You can update these yourself anytime you want in the template frame file. Infact, if you want you can remove the dynamic data all together.

              But then you run into the issue of the browser not updating if you make significant changes to the CSS. (Which is why they have it like that, as you pointed out)



              • #8
                NMTEACO I'm not sure that's possible either. Last time I attempted (right before Black Friday, which was version 7.4.0), appending your own URL parameter/query string would just lead to their system prepending theirs before yours.

                For example, normally, in your template you would have something like:

                <script src="assets/templates/[template]/js/somejsfile.js></script>

                And 3dCart's system transforms that into:

                <script src="assets/templates/[template]/js/somejsfile.js?vcart=7.4.1></script>

                And if you try to add your own like:

                <script src="assets/templates/[template]/js/somejsfile.js?myScriptVersion=2.0></script>

                3dCart's system transformed it into:

                <script src="assets/templates/[template]/js/somejsfile.js?vcart=7.4.1&myScriptVersion=2.0></script>

                Which should in theory invalidate browser cache since the query string has changed... but in my testing with Chrome, it did not respect that. YMMV...

                No where in the template is there a variable/placeholder for the query string 3dCart injects... so you don't really have an option to disable that (at least that I've found). It would indeed be a nice feature to have some area in the admin to specify what the query string should be, so that you can update it when you make changes to your site, without having to hack your templates every time (or just wait for browser caches to expire).

                Note: We use cloudflare, so extra caching is going on, however caching levels are set to "standard", which respect query strings... so I still believe some browsers (at least Chrome, but I've read Opera and Safari might be culprits too) are caching more aggressively than we might like.


                • #9
                  Alupis , I see what your saying. I was confused because I added my own variable to the string so that I could update when I want.

                  <link rel="stylesheet" href="assets/templates/[template]/css/material_layout.css?v=1.4" type="text/css" media="screen" />
                  So this way when I make changes and I want them to update now, I can change "v=1.4" to "v=1.5"

                  I had not realized they are also adding their own variable. So I have a solution if you want to update the page more often, but no solution if you want the link to not have a variable.


                  • #10
                    Hoping for some advise. In late Nov / early December, my custom carousel stopped working. I never got around to figuring out why, until now. I believe the issue is that their scripts do not like the injection of this parameter... what starts out as

                    <script type="text/javascript" src="/assets/templates/fb/slider/engine1/wowslider.js"></script>

                    turns into

                    <script type="text/javascript" src="/assets/templates/fb/slider/engine1/wowslider.js?vcart=7.5.0"></script>

                    (just one example, there are actually a few places where this happens).

                    Is there a way that I can stop this parameter from being appended? I have tried a few things, but haven't had much luck...

                    (Just to level set any expectations, I am an html hacker at best, the custom template for my cart was developed by someone else, and I can do minor tweaks, but big changes are outside my skill set...)

                    The carousel is on my home page: and we also use cloudflare....

                    In case you were wondering why I have a custom carousel, it was because at the time we did our template, the 3dcart carousel was not responsive... I don't know if that has changed in the last year....
                    Last edited by FotoBella; 03-15-2017, 10:25 PM.


                    • #11
                      I found a solution... if you use an absolute path to the src, the parameter isn't injects...


                      <script type="text/javascript" src=""></script>

                      I always try not to do this since when in HTTPS mode the browser gives errors, but at least the carousel is working again!