3
avedis
7y

When cdn caches erroneous scripts... good luck solving it "asap"

Comments
  • 3
    Good cdn has a way to clear the cache or trigger reload of some content.

    We use a technique called fingerprinting where all js and css gets prefixed with a unique fingerprint in the path.

    This is handled by a module in the server and depends on a checksum of the file.

    As long as the file is unchanged it can be cached indefinitely but once it changes all pages will be on the fly rewritten with the new version causing an immediate reload bypassing the cache.

    As a bonus it refreshes even client side caching.
  • 0
    Yup! CDNs require a good way to bust cache. I use version tags but I like the file checksum idea too!
  • 0
    @Voxera which cdb is this?... my vps is on media temple who have partnered up with SiteLock's TrueCDN.
    They dont have a dashboard, just a button clear cache and deactivate / activate.
  • 1
    @avedis we do not use CDN as such but the fingerprinting is a module for iis that a colleague wrote.

    Together with the rewrite module to update urls in all pages after rendering is complete before sending to client.
  • 1
    @Voxera ohhh okay... my issue for using CDN had nothing to do with caching. caching is easy to handle for me. i add specific provisions for Nginx, and my framework does exactly what your colleague has developed if i want to.
    All resources will be appended with an asset updated timestamp as such:

    css/theme.css?1493907934
Add Comment