inertiajs / inertia-rails

The Rails adapter for Inertia.js.
https://inertiajs.com
MIT License
529 stars 43 forks source link

Is "Partial Page Reload" on browser back/forward navigation a built-in feature? #127

Closed AlvesJorge closed 2 months ago

AlvesJorge commented 2 months ago

More specifically: When you navigate with Link or router the inertia protocol knows to only fetch relevant new data served by the controller, and not JS assets already present in the current page.

However, in my app, this is not the case when using the back / forward button in your browser. I found that in the Ping-CRM App (site | repo) this feature works, you can open the network tab in your browser and see that going back and forward between pages doesn't cause a full assets refetch.

My question is: is this a built-in feature and I did something wrong in my application? Or is this a feature present in pingcrm because he explicitly configured it somewhere.

Thank you and apologies for not really an "issue" again.

PS: I know partial page reload could refer to a different paradigm but I didn't know how else to address this. Which is probably a reason why I can't find a lot of info on this 😅

AlvesJorge commented 2 months ago

Closing I found out what the "issue" is.

This "partial reload" only happens if you navigated between pages using router and link.

If you open link 1 through writing the URL in the browser, and open link 2 also through writing the URL in the browser, and you move back and forth between them, you will reload all assets. But if you navigated between link 1 and 2 using Link or router and you move back and forth between them you will not trigger a full reload.