-
- 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?
-
- 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.
-
- 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.
-
- 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>
-
- 5,888 Posts
like here:
Quote from: lkfranklin at Jan 17, 2017, 04:05 PMIs 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:
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">
-
- 932 Posts
Hi Missusdoubleyou,
When you input a query string it needs to be after the file extension so it reads
rather than
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.
-
- 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" />
-
- 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.