loading...

Do we still need turbolinks/PJAX?

twitter logo github logo ・1 min read

While messing around with a server-rendered web application, I was thinking of dropping PJAX in to make page changes smoother, but I tested on a couple different browsers and it seems they all fetch the new page in the background and replace it after (like PJAX but with a proper style/JS refresh).

With that in mind: is there still a use case for PJAX/turbolinks?

twitter logo DISCUSS (3)
markdown guide
 

Any references to browser documentation? Would be intetesting to understand differences in technical implementation .

I can just assume, that browser does full page refresh it makes it looks smoother, but not much gain in performance.

With turbolinks you can refresh only part of the page, leaving other things intact (or with minimum changes).

 

Browsers tends to get better and better at rendering pages smoothly. But one thing turbolinks (and such) will always improve is load time.
When you fetch twice the same resource (css, js ...), your browser reload from local cache (disk), but it reloads it anyway (plus parsing and such).
Even better, some lib will preload the target page when the user hover the link. It take a minimum of 100ms for someone to click a link, these time is used to load the next page.
Ever asked yourself why Dev.to is so fast to load ? Take a look at your debugger's network panel and hover any link.

 

That makes a lot of sense, it's less about the flash to white of a page navigation and more about performance and responsiveness of the page.

Classic DEV Post from Jun 25 '19

What does your Junior interview process involve?

Explain what your junior interview process involves and what you look for in junior candidates.

Hugo Di Francesco profile image
Developer, JavaScript, CSS and web. Writing at Code with Hugo.

dev.to now has dark theme. 🌝

Go to the "misc" section of your settings and select night theme

P.S. It's the best move you can make for your dev career.