2

I've noticed in the last couple years that many websites now do a full page refresh every time you return to the page by pressing the Back button. This is very annoying, especially on cellular or slower internet connections.

Can a browser extension prevent this page reload being triggered upon pressing Back?

Note: I'm not talking about a reload forced by the browser or OS due to memory pressure. This is a proactive reload that the website itself triggers upon sensing that the page has been made active or gained focus again.

The worst offender is Reddit. If you click on a topic to read the comments, then press Back, there's a 5 second delay as the topic list is reloaded, all the votes are recalculated, all the comments are tallied, etc. I don't want any of that to happen, I just want to quickly go back to the previous topic list I had been viewing.

Test yourself on various websites. Click on a topic/comments, then press Back.

Hacker News and Stack Exchange are both pretty fast. No reload. No recalculations. Just shows you the previous topic list.

Reddit is dreadfully slow and forces a full page reload every time you press Back. Other websites do this as well.

I'm searching for a browser extension for Safari or Chrome that can prevent this entire class of page reload, on all websites. What mechanism are the websites using to trigger a reload/refresh and how can it be intercepted and blocked?

pkamb
  • 4,775
  • 6
  • 40
  • 52

1 Answers1

1

HTTP Response headers for the HTML pages from Reddit look like this,

accept-ranges: bytes
cache-control: private, s-maxage=0, max-age=0, must-revalidate, no-store

So the web site is asking the browser not to cache the page, via the max-age flag.

However for some elements of the page, like Javascript files, they do request caching (for 7 days, which is 604800 seconds).

accept-ranges: bytes
cache-control: max-age=604800

So a large part of the content should be cached. Maybe your phone or internet connection is slow?