Announcement

Collapse

Posting Rules

Posting Rules
This forum was created to help 3dcart users share tips on getting the best out of the service, offer knowledge and experiences about e-commerce in general, and to promote a positive environment in which our merchants can request/dispense advice regarding best practices.

The forum was not created for 3dcart users to submit requests for customer support. Any support related thread will be removed and a support ticket will be placed on your behalf. If you have technical difficulties please visit http://support.3dcart.com.

The 3dcart forum is also not intended to be a medium in which to express dissatisfaction about 3dcart's service, policies or its management and staff. Threads of this nature will also be removed from the forum. If a support issue with your 3dcart store was not resolved in a satisfactory manner; or if you feel that a particular 3dcart offering/policy is not to your liking, please let us know by emailing [email protected] so we can address your concerns directly.

Again, our purpose is to cultivate a positive learning environment for our merchants rather than platform in which to express grievances.

Very Important Rules:
* Never give away your store administration login/password in this forum.

Should you need technical help, please let 3dcart staff help.
Also, please be aware that 3dcart staff will NEVER need to ask for your 3dcart related passwords.

General Rules:
* While debate and discussion are acceptable, we will never tolerate rudeness, insulting posts, personal attacks or inflammatory posts. Our decision is final in these matters.
* Please refrain from posting meaningless threads, one word (or short) nonsensical posts, or similar postings.
* Multiple or repeated posting in order to increase your post count is not allowed.
* Advertising, spamming and trolling is not allowed. This includes using the forum email and Private message system to spam other members.
* We also do not allow posts that are sexual in nature.
* Please wait at least 24 hours before bumping posts.
* Discussion of illegal activities such as software and music piracy and other intellectual property violations are not allowed.
* Each member is allowed one login account. Registering with multiple accounts is not allowed.
* We reserve the right to remove offensive posts without notice.
* We also reserve the right to remove postings which are in violation of our specified posting rules
* Also, while these rules cover most common situations, they cannot anticipate everything. Consequently, we reserve the right to take any actions we deem appropriate to ensure these forums are not disrupted or abused in any way.
* You cannot post any affiliate or referral links, or post anything asking for a referral. Such posts will be subject to removal.
* You cannot post advertisements or notices for contests.
* We also reserve the right to ban anyone who willfully violates the forum rules, as access to our support forums are a privilege and not a right. A banned customer is still entitled to support from the support system, but will not be able to participate in the forum.
See more
See less

Force Cache Update for customers after updating frame elements?

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Force Cache Update for customers after updating frame elements?

    I made a change to the header on my website among other things. The cache in some browsers has held onto this and the next time you open my website you get a bit of a mess. The site still operates but it looks poor. I reset the store cache but nothing seems to work unless I clear the browsers cache. My customers will not know how to do that. They will deal with it until their browser finally figures out it needs to update the cache.

    Is there a way to force the cache update in 3dcart when I make changes like this? I heard you can do a cache busting technique but how do I apply that to 3dcart stores?

    HTML Code:
      <link rel="stylesheet" href="assets/templates/[template]/css/[stylesheet]" type="text/css" media="screen" />
    Edit this string? Add a 1 at the end of stylesheet outside the [] ?

    3dcart support says clearing the store cache is supposed to fix this but it does not. I take it that 3dcart support is wrong.

  • #2
    What they told you was not correct. Browsers cache the CSS files for a month so unless you change the name of the file or add something extra for versioning it won't work.

    We change the name of the stylesheet every time using a different method so I'm not sure what the exact correct way is to do that. I have seen sites that add an additional version number that ends up looking like this at the end - default_modified.css?vcart=8.0.1&v=2.019 but I've never done that and don't recommend you try it without someone who knows for sure to explain it. Hopefully thats enough information that 3dcart support can point you in the right direction.

    Comment


    • #3
      1. You cannot control a customers browser cache. When you clear your store cache it essentially requests the browser to use the newest version. The browser will typically default to whatever the user has set in their personal browser settings, which includes the cache holding size and sometimes date clear times in which there isn't a default. For example, I use 0mb cache holding so I see changes automatically without clearing browser cache.

      2. As the store owner it is always good practice to clear store and browser cache after any changes so you can see that your changes are working correctly

      3. Customers are more than likely not on the store as much as you are, so it is more likely that most customers will never see any issues after you make changes and will see what they should.

      Just do your due diligence by clearing store cache after changes and that will at least allow the browser to function as set.
      TheCartDesigner.com
      Not 3dcart Owned or Operated
      100% Independent 3dcart Expert


      Follow Us on Twitter

      Comment


      • #4
        Hey Shaun, 3dcart is setting css files to be cached by the browser for 30 days by default. In at least Chrome and Firefox they don't check the css file again for 30 days unless you override that by setting custom cache settings in your browser.

        If you make changes to the css file but don't change the name or version, how will the browser know to look again? We've never been able to get that to work in 3dcart and they've told us that changes to css, js, etc need to be renamed or have that extra version number added at the end.

        That doesn't apply to stuff you add or change in the Header or Footer of pages through 3dcarts admin of course. Those do update right away. But to the best of my knowledge if you change any css or js file (or image) and don't rename or reversion it there is no way to tell a customers browser to check again.

        What am I missing here? It would be a BIG help if we could make changes to static files without having to rename them every time!

        Comment


        • #5
          If you make a lot of changes to your site .css, the best way to do this is to add a querystring, and change versions as you make updates.
          ie.

          assets/templates/[template]/css/[stylesheet]?v=1.0.0" And then next week, when/if you make a change, update the frame.html to be assets/templates/[template]/css/[stylesheet]?v=1.0.1 or whatever. This will force your browser (or your customer's) to re-download the .css since it's no longer a 100% match to the one downloaded earlier. If you don't cache .css files, you'll get penalized for having a slow site, because the .css would need to be downloaded on every page, by adding a version#, you can make sure that the css is re-downloaded when you change versions.
          ----------------------------
          Gonzalo Gil
          3dCart Support
          800-828-6650 x111

          Comment


          • #6
            Thanks Gil!

            Comment


            • #7
              Hey Gonzalo,

              Your response is crazy interesting to me. Here is why.

              Years ago I had a client with crazy caching issues and was told that this is suppose to be what happened dynamically on the system side when you click clear store cache. As it was explained to me, when you click clear store cache the system generates an appending version sequence (might have just been number sequence) on the system side which basically requests (or tells) the browser to use the newer version. If that is not the case what I really wonder is why I have only come across very very limited issues with all my clients that do use caching and further more... Is there a reason can't be dynamic as was explained to me so long ago?
              TheCartDesigner.com
              Not 3dcart Owned or Operated
              100% Independent 3dcart Expert


              Follow Us on Twitter

              Comment


              • #8
                thecartdesigner, the clear cache, or even clicking the view store button on admin will clear the server side cache...that's the cache of what items display on categories, home page, or recent blog posts, etc, it shaves off a few milliseconds by not having to hit the database each page load, but client side cache, like .css or images that cached on the browser itself, there is no way for the server to affect those. However, by appending a query string to those assets and changing it as you make edits, that will do the trick. Thinking through about this, we could do this automatically, appending a number to elements as you change them, images, or .css, but i'll have to think of a way to make it work in all cases to make it part of the software.

                We are also working in adding a CDN to the mix, to make static elements download closer to you, we are in beta stages of this already with new accounts getting this and it makes rendering pages alot faster (Particularly for visitors who are visiting for the first time), so this will affect how cache is cleared on those situations, but, the query string approach will work on all scenarios, so probably the way we'll implement it.

                So at least for now changing the query string to the static files when you change them is the best way to go about this...
                ----------------------------
                Gonzalo Gil
                3dCart Support
                800-828-6650 x111

                Comment


                • #9
                  GonzaloGil

                  Those are some really good things that I think could make the masses happy. It would especially be great if the cache could do as I thought it always has done already...lol
                  TheCartDesigner.com
                  Not 3dcart Owned or Operated
                  100% Independent 3dcart Expert


                  Follow Us on Twitter

                  Comment


                  • #10
                    Gil - since you are working on a new CDN and considering versioning, if you can (which maybe you can't) it's best to avoid query strings and use a unique filename, by appending a random number or whatever. It's pretty rare that a cache or proxy strips out query strings anymore but it can happen, and some CDNs default to not caching query strings. It can also cause issues with third party stuff like Cloudinary.

                    Since you are using a new name and not just a query string you don't have to overwrite the old file. So if someone makes a change and it breaks something or whatever you can just switch the html back to point to the previous file. And you can be 100% sure that everyone is getting the latest file all at the same time. So 3dcart and Cart Designer and everyone else will never have to tell their clients to clear their browsers cache again :)

                    Comment


                    • #11
                      Changing the name of the stylesheet after each large edit will be something I do from now on. I was under the impression simply refreshing the store cache resolved these issues. It might for minor changes but frame edits often go unchanged in the browser cache it seems according to the settings. You learn a bit each day :)

                      Comment


                      • #12
                        Gil, where would you make the name change?
                        http://www.pack-secure.com

                        Packaging and Shipping Supply Specialists

                        Comment


                        • #13
                          Pack Secure, i think what they are saying is that they would save the new CSS as say style-01.css, and reference that on the frame.html...which as Lukiegames mentioned. it is probably the best way, so you can always go back to a previous version of the CSS if something went wrong.
                          ----------------------------
                          Gonzalo Gil
                          3dCart Support
                          800-828-6650 x111

                          Comment


                          • #14
                            That's exactly correct. Just save it with a new name, you can add the date or whatever you want like mycustomcss-031319.css. Then change the HTML on the frame to point to that. Clear the store cache and everyone will get the new file immediately.

                            Alternatively if you are using 3dcarts built in method of choosing themes and css I THINK you can also just go to Settings - Themes & Styles, and select the new stylesheet there. That will only work for the main css file and not javascript or any other files but most places use that and its even easier. Please double-check or test before trying since that's not the method we use and I can't verify with 100% certainty.

                            Comment


                            • #15
                              I re-named it and it still does not work. Chrome will NOT see the changes I make until I manually remove the cache on the browser. I edit the stylesheet name, go select it under themes and then refresh the store cache. Chrome still will not see it.

                              Comment

                              Working...
                              X