Ask A Question

Notifications

You’re not receiving notifications from this thread.

How To Use Turbolinks clearCache() Discussion

Alejandro Ventura Alejandro Ventura

Does it works only for JS responses? Or it could be used in html responses and how to do that?

Reply

It's a Javascript method, so it must be done in Javascript. You only need to call this if data changes during a request. If you're making a POST/PUT/DELETE not via Javascript, you wouldn't need this because your browser will not be loading the next page view JS.

Reply

@excid3:disqus As far as I can tell the caching used by turbolinks is not available offline. Do you agree with this?

Reply

Well the turbolinks cache is designed to display the previous page quickly before refreshing it with the latest version. It's not designed for offline work, just to speed up the page.

Basecamp's mobile app basically just implements a "The internet connection appears to be offline" for pages and a reload button till the user is back online. ServiceWorkers in HTML5 are designed to help make offline functionality of web pages a bit better, but if it's a mobile app you may also want to build out some views natively so that they still function offline.

Reply
Is there anyway to invoke this when moving between layouts? I often (but not always) need a screen refresh when moving from application.html.erb to admin.html.erb (different layout and stylesheets)
Reply
Join the discussion
Create an account Log in

Want to stay up-to-date with Ruby on Rails?

Join 86,796+ developers who get early access to new tutorials, screencasts, articles, and more.

    We care about the protection of your data. Read our Privacy Policy.