No More Posting New Topics!

If you have a question or an issue, please start a thread in our Github Discussions Forum.
This forum is closed for new threads/ topics.

Navigation

    Quasar Framework

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search

    Update browser cache when publishing new version (without CTRL+F5)

    Help
    2
    5
    860
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • A
      apavel last edited by apavel

      Hi there,

      First of all, thank you very much for creating such an amazing framework! I deployed an awesome website, and I am having a lot of fun with it.

      I have a question: Whenever I publish a new version of the site, the users still see the old site because it is cached in their browser.

      Is there a way to instruct quasar to create version numbers when referencing each chunk file (i.e. chunk.js?v=###hash). This usually forces the browser to reload the resources. I know each chunk is named with a hash, but somehow this doesn’t force chrome to reload resources (I have to tell users to CTRL+F5).

      I searched the form for this solution, but the answers were from 2017, and don’t apply.

      Thanks!!
      Pavel

      1 Reply Last reply Reply Quote 0
      • dobbel
        dobbel last edited by

        You can make a PWA that auto updates itself. The Quasar website( made in quasar) does the same.

        1 Reply Last reply Reply Quote 0
        • A
          apavel last edited by

          Thanks for your reply, but we don’t need PWA currently. anyone else have any ideas?

          1 Reply Last reply Reply Quote 0
          • A
            apavel last edited by

            I figured it out. I tried setting the <meta tags, but it never works.
            It seems the issue is with the server setting cache headings. I made a change to the nginx sites-available file:

                location / {
                        try_files $uri $uri/ =404;
                        add_header Cache-Control "no-store, no-cache, must-revalidate";
                }
            
                location /static {
                        expires 30d;
                        add_header Cache-Control "public";
                        access_log off;
                }
            dobbel 1 Reply Last reply Reply Quote 0
            • dobbel
              dobbel @apavel last edited by

              @apavel very useful!

              1 Reply Last reply Reply Quote 0
              • First post
                Last post