D
D
Denis Bogdanov2018-02-22 22:14:00
JavaScript
Denis Bogdanov, 2018-02-22 22:14:00

How to load the entire page when going back using ajax?

There is a product page with pagination. Page transitions are asynchronous. Accordingly, with each transition, I push the state to history. When I click on the back button I use onpopstate and everything works fine as it should. But as soon as you go to the product card (a synchronous request is already happening here) and click on the back button, only dynamic content without styles and static blocks gets from history. How to fix such a situation? Thank you.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Denis Bogdanov, 2018-02-25
@den-bogdanov

You need to disable caching http requests for the browser. In the response from the server, set the Cache-Control header: no-cache, no-store, must-revalidate

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question