Does Rails Turbolinks 5 irritate ui?

My rail application flickers during the transition. Probably Turbolinks is the culprit. Does anyone know how to stop flickering or why does it flicker at all?

If you follow the link below and click on any of the login buttons, you will copy what I experience.

The strange thing is that there is no problem accessing it from firefox or safari. Does this only happen in the latest version of Chrome and Internet Explorer? So I'm not sure if this is a problem with the browser.

+4
source share
1 answer

Flickering occurs when the cache loads just before turbolinks overwrites it with new content. I was able to fix this by placing (in the <head>layout) the following code:

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

The above code disables the turbolinks caching feature. No caching == no interface flickering. However, using the back or forward buttons in the browser will now make a network call (still via Turbolinks)

See sample code: https://github.com/DockerOnRails/todomvc-turbolinks


There is also another possibility to clear the cache before using it Turbolink.visit(which causes the user interface to flicker): by calling Turbolinks.clearCache(), this will do the same as disabling the cache, but it gives you the option to save using the cache in other places.

+1

Source: https://habr.com/ru/post/1656755/


All Articles