animate-rails icon indicating copy to clipboard operation
animate-rails copied to clipboard

How to deal with Turbolinks 5?

Open mrkongo opened this issue 9 years ago • 1 comments

How to deal with Turbolinks 5?

Every time I click on a link the animation run two times!

<h1 class="animated infinite bounce">Example</h1>

Why?

mrkongo avatar Aug 02 '16 21:08 mrkongo

This is due to caching feature in Turbolinks 5. See this section of the README:

Otherwise, during standard navigation (via Application Visits), Turbolinks will immediately restore the page from cache and display it as a preview while simultaneously loading a fresh copy from the network. This gives the illusion of instantaneous page loads for frequently accessed locations.

To prevent the animation display twice, a quick hack is to disable the preview cache. Read Opting out of caching and add this to your <head>

<meta name="turbolinks-cache-control" content="no-preview">

nqngo avatar Sep 13 '16 23:09 nqngo