-3

Summary my situation: I have 2 page:
- page 1 send request $.ajax and get JSON to show. Then in page 1 has a button click --> page 2.
- after I clicked this button, I'm in page 2. I click back button in browser to come back page 1.
- then page 1 send request $.ajax.
- I want that when i click back button in browser, it comes back page 1 and uses old JSON that was received to show and don't send request.
there're anyone who knows about this. Please help me!.
Thanks!

  • You can cache your response: http://stackoverflow.com/a/12372670/3882178 and make a far future expiry-header! – loveNoHate Sep 15 '14 at 15:15

1 Answers1

0

I don't know how much text it is you want to store.
but since it is json result I think its pretty much.
I haven't used this but you could save it on the disk and load it from there
Look into this : https://github.com/eligrey/FileSaver.js
You have to save it somewhere if you don't want to make the request again.
filesystem, cookie, cache, session. somewhere else :)

VRC
  • 745
  • 7
  • 16