Changes to CSS not reflected in pages viewed in Browser till much later

Has anyone else experienced any issue with making changes to CSS files in the CMS but when you review pages effected they are not picking up the new CSS content?

I ave cleared cache and done a forced refresh (Shft+F5) all to no avail. Viewing the CSS file in developer mode shows the old version of the CSS file without the changes reflected.

At some stage later the changes flow through

Thanks
Greg Tomkins

I haven’t experienced this myself but have seen it come up a few times on and off.

If it helps, during development, I’ll add this to the end of any asset file src URLs that I don’t want cached:
{% "now" | date: "%r" | replace:':', '-' | replace:' ', '-' | prepend:'?v=' %}
So this gives something like:
<link rel="stylesheet" href="/assets/css/app.css?v=1-13-35-PM">
Basically just gives the src a new URL every page load so the server sees it as a different file.

If you have many assets you can pass this to a variable for easier management, ie:
{% assign cacheControl = "now" | date: "%r" | replace:':', '-' | replace:' ', '-' | prepend:'?v=' %}
Then:
<link rel="stylesheet" href="/assets/css/app.css{{cacheControl}}">

1 Like

Thanks Adam I knew of this technique although not automated as you have suggested.

My question is why am I seeing this as this is a real problem as I make changes to a production site and find that the web is not seeing those changes for some time period.

Is this an issue with the config of the Treepl servers becasue I have never seen this sort of thing elsewhere

Greg

I would guess it’s at the Treepl server end. Unless you are running the domain through another service, like Cloudflare for example, where that service can further control caching and other file serving aspects.

BC would cache files as well (it’s a good thing when done right) and I do recall there being odd occasion where BC would be caching to heavily and this type of thing would happen. But it always seemed to be temporary and on a per site basis.
Perhaps it’s an automated system that adjusts the caching level per site???

Treepl team would need to chime in here for more details. @vlad.z?

The issue with such caching may be caused if you use Cloudflare or any other DNS provider for your site.
Does your site with the caching issue use one?

Hi Vlad… Only one script file is loaded from cloudflare (as shown below) - all the rest are loaded dircetly from the Treepl site itself

//cdnjs.cloudflare.com/ajax/libs/jquery-form-validator/2.3.26/jquery.form-validator.min.js

Greg

Vlad and I were referring to actually running your DNS through a service like Cloudflare, in which they then can route traffic and assets through their infrastructure too.
Where is the DNS hosted for the site in question?

The DNS is managed by their IT Partner so I have no control over this but on just having run DNS analysis I get the following results which would be suggesting that the site domain is running through cloudflare…

nbtax.com.au

IP 104.28.26.16
IP 1 104.28.27.16
COUNTRY NAME United States
REGION NAME CA
CITY San Francisco
PROVIDER (ORG) N/A

Common records

HINFO
host class ttl cpu os


nbtax.com.au IN 3789 ANY obsoleted See draft-ietf-dnsop-refuse-any
cpu : IANA number designating the CPU of the machine referenced by this record.
os : IANA number designating the Operating System on the machine referenced by this record.

A
host class ttl ip


nbtax.com.au IN 300 104.28.27.16
nbtax.com.au IN 300 104.28.26.16
ip : An IPv4 addresses in dotted decimal notation.

NS
host class ttl target


nbtax.com.au IN 900 zoe.ns.cloudflare.com
nbtax.com.au IN 900 micah.ns.cloudflare.com
target : FQDN of the name server which is authoritative for this hostname.

Yep, looks like it.
So I’d say there are caching settings applied there which are effecting your site assets.

1 Like

Ok thanks for the help on this Adam… I’m blowed if I can ever understand why business owners can ever think they can build and manage a website themselves when we have to deal with and understand so many different situations to support our own clients…

Greg

Ha ha, yep. Ignorance is bliss I guess!