0

Basically what I want is this: https://dev.to/videos

You can select an item -> new page with item loads -> you click on backward button -> the old page is loaded from cache

I want that the same search page shown to user on navigation back, without calling the async fetch method again.

A solution seems to be SPA? But that is an enormous overhead. I know how to do this with SPA. I need way without SPA.

iPhone, Android and Safari have a backforward-cache enabled by default, so no problem there. Static pages also don't have any problems.

I don't need any excact JavaScript code. I just want to know how do other websites solve this problem? Is SPA the only way? Are there any "frameworks" to solve this problem?

curl
  • 1
  • Please edit the question to limit it to a specific problem with enough detail to identify an adequate answer. – Community Oct 16 '21 at 18:29

1 Answers1

0

If server allows the page to be cached, your browser won't send a request again before the page expires.

https://stackoverflow.com/a/36554152/14263615

HolaPz
  • 106
  • 3