MoOx / pjax

Easily enable fast Ajax navigation on any website (using pushState + xhr)
MIT License
1.43k stars 124 forks source link

Make X-PJAX headers optional #224

Open nateberkopec opened 4 years ago

nateberkopec commented 4 years ago

I preload documents using rel=preload, and because PJAX adds headers to the request, it cannot use those preloaded documents.

Simply removing the headers works and no network requests are sent on a PJAX navigation. Should we make them optional? What should that option be called?

Connum commented 4 years ago

I'm currently trying to implement instant.page (which uses <link rel="preload">) in addition to pjax and I'm facing the same issue. Have you found a workaround? How did you remove the headers to see that it works? By modifying the code of the package manually?