Search code examples
turbolinks

How to get turbolinks to always fetch a page from server


If I have a page that should never be cached and should always be retrieved from the server, how can I get turbolinks to do this when the user presses the back button? Will it just obey cache-control directives from the http response?


Solution

  • This has changed in Turbolinks 5, now you need to set this at the <head> level for a page to not be cached:

    <head>
      ...
      <meta name="turbolinks-cache-control" content="no-cache">
      ...
    </head>
    

    Reference: https://github.com/turbolinks/turbolinks#opting-out-of-caching