We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 17301
    • 932 Posts
    If you open the stylesheet up in your browser directly is it updated?

    If you edit it in the backend manager by using the files tab does it instantly update then?
      ■ email: [email protected] | ■ website: https://alienbuild.uk

      The greatest compliment you can give back to us, is to spend a few seconds leaving a rating at our trustpilot: https://uk.trustpilot.com/review/alienbuild.uk about the service we provided. We always drop mention of services offered by businesses we've worked with in the past to those of interest.
      • 50485
      • 56 Posts
      HI LK

      No, if inspect the css file in a browser it is not updated. I am using the backend manager and files tab. It is making development impossible, when the page doesn't update for anywhere between 10 mins and hours! It is the same for all browsers - and then when i discover one is updated they all are. As I have said it seems like there is some time lag to "publishing".

      Any other suggestions most welcome.
        • 4172
        • 5,888 Posts
        just for debugging the issue, I would, like LK has suggested, try to add a unique query-param, each time you change the CSS-file.
        And see, if that updates the CSS-file in the browser.
        If that helps, you could with a little snippet get the filemtime of the CSS-file and change the query-param dynamically.
          -------------------------------

          you can buy me a beer, if you like MIGX

          http://webcmsolutions.de/migx.html

          Thanks!
          • 50485
          • 56 Posts
          Hi Bruno and LK

          Forgive me but I have never used a query param. Do I just add some unique text at the end of the file name such as style20170119.css, save this in assets and then update the link to the file in my <head>

            • 4172
            • 5,888 Posts
            like here:

            Quote from: lkfranklin at Jan 17, 2017, 04:05 PM
            Is it possibly local/browser or even ISP cache?

            Try putting a query string at the end of your CSS file when you update it. ie:

            <link href="assets/css/style.css?17012017" rel="stylesheet" type="text/css">



            you change this part after changing the CSS:

            ?17012017


            if that works, we can try to create a snippet, which does this dynamically. Will look like that then:

            <link href="assets/css/style.css?[[!getFilemtime? &filename=`assets/css/style.css`]]" rel="stylesheet" type="text/css">
              -------------------------------

              you can buy me a beer, if you like MIGX

              http://webcmsolutions.de/migx.html

              Thanks!
              • 50485
              • 56 Posts
              Hi Bruno

              I presume I am doing something wrong as now the css isnt loading.

              I have altered the style.css file, and renamed it style?17012017.css and then altered the link address as you say:

              	<link rel="stylesheet" type="text/css" href="assets/css/style?17012017.css" />


              What am I doing wrong?

              Sorry, Su
                • 50485
                • 56 Posts
                Hi Bruno

                I presume I am doing something wrong as now the css isnt loading.

                I have altered the style.css file, and renamed it style?17012017.css and then altered the link address as you say:

                	<link rel="stylesheet" type="text/css" href="assets/css/style?17012017.css" />


                What am I doing wrong?

                Sorry, Su
                  • 17301
                  • 932 Posts
                  Hi Missusdoubleyou,

                  When you input a query string it needs to be after the file extension so it reads

                  style.css?19012017


                  rather than

                  style?19012017.css


                  Also don't use Brunos suggested line of code just yet - the snippet would need to be coded for that to work. He was just putting it up as an example of how it would look if the above method worked and you needed a snippet coding to add on a unique query string everytime.
                    ■ email: [email protected] | ■ website: https://alienbuild.uk

                    The greatest compliment you can give back to us, is to spend a few seconds leaving a rating at our trustpilot: https://uk.trustpilot.com/review/alienbuild.uk about the service we provided. We always drop mention of services offered by businesses we've worked with in the past to those of interest.
                    • 17301
                    • 932 Posts
                    I should probably also clarify that you don't actually rename your file keep that as style.css but in the HTML header where you link up the stylesheet you add in the query string.

                    So that it reads:

                    <link rel="stylesheet" type="text/css" href="assets/css/style.css?19012017" />

                      ■ email: [email protected] | ■ website: https://alienbuild.uk

                      The greatest compliment you can give back to us, is to spend a few seconds leaving a rating at our trustpilot: https://uk.trustpilot.com/review/alienbuild.uk about the service we provided. We always drop mention of services offered by businesses we've worked with in the past to those of interest.
                      • 50485
                      • 56 Posts
                      LK and Bruno

                      Thank you - your solution works, as does that just provided by my hosting provider - I have to use their SuperCacher service.

                      Once again, thanks for your help.