Sign in

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

  • This topic has 5 replies, 3 voices, and was last updated 3 months, 3 weeks ago by .
Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #7939
    Avatar photokonstantin

    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

     

    --
    Do you appreciate the support you've received today? If so, consider donating to the Publii team by clicking here; we'll be sure to use your donation to make Publii even better!

    #7944
    Avatar photokonstantin

    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 photoTomasz Dziuda

    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.

    --
    Do you appreciate the support you've received today? If so, consider donating to the Publii team by clicking here; we'll be sure to use your donation to make Publii even better!

    #7949
    Avatar photokonstantin

    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 photoTomasz Dziuda

    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

    --
    Do you appreciate the support you've received today? If so, consider donating to the Publii team by clicking here; we'll be sure to use your donation to make Publii even better!

Viewing 6 posts - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.