Download
We're evolving to serve you better! This current forum has transitioned to read-only mode. For new discussions, support, and engagement, we've moved to GitHub Discussions.

How do we clear the browser cache for clients during web development?

  • #7939
    Avatar photo[anonymous]

    Does Publii have a feature that would force my client’s computer and client’s clients who are browsing the new website to load an updated cache clean version of the site?

    #7940
    Avatar photoBob

    There is an option to add a version parameter in CSS/JS URLs to skip the browser cache.

    screenshot-2022-08-02-at-15.27.20

    #7944
    Avatar photo[anonymous]

    That’s a really nice feature!

    And it looks like it was on by default. The new changes were not visible anyway, and I had to use hard refresh to get them.

    #7946
    Avatar photo[anonymous]

    Hi @konstantin,

    If your HTML files are also cached with longer TTL, then most probably the hard refresh will be necessary anyway. Because browser still tries to download CSS/JS with use of the old version parameter. The only solution in this case is set short TTL for HTML files and long TTL for CSS/JS and other asset files.

    #7949
    Avatar photo[anonymous]

    I don’t know if my HTML files are cached or not. They are the files that are produced by Publii.

    What is TTL? I don’t understand such technology.

    Is there not a simple way to let the cache machine think that the site is totally new?

    #8060
    Avatar photo[anonymous]

    Please consider using .htaccess – you can disable browser cache only for HTML files – examples:

    https://www.a2hosting.com/kb/developer-corner/apache-web-server/turning-off-caching-using-htaccess

    In the article you have custom rules for all files and only specific types of files. Of course your hosting must support .htaccess files