12

I love the real time updates to questions, answers, and inbox we have now, since my F5 key was starting to wear out.

There's one scenario though that still makes me refresh manually. I'll illustrate for questions:

While looking at Recently Active 'javascript' Questions - Stack Overflow, suddenly banner reading

1 question with new activity

appears. I click it, and the most recently active questions, Question B, appears on top of the other questions:

Question B
Question A
...

I open a question that looks interesting. After reading it, I navigate back, and Question B disappeared from the list.

That would be alright if they came back with the next real time update. Sure enough, the banner reading

1 question with new activity

pops up after a few seconds. To my surprise, now I have

Question C
Question A
...

and Question B went to limbo until I refresh the page.

Real time updates to answers, comments and edits behave similarly.

2
  • I believe this is due to server cache that updates once in a minute or two rather than back button issue. Commented May 2, 2012 at 7:52
  • Reproduced. Go here and wait for "1 question with.." to appear.Click it. Refresh the page with F5 and... question is gone! Commented May 2, 2012 at 8:05

1 Answer 1

1

This is due to your browser caching the page.

When the browser recieves the page, it stores a copy of the recieved page with itself--so if you hit the back button, you get to see this cached page. You can test this by opening a random page, clicking a link on it, disconnecting yourself from the Internet(noooo!), and hitting 'back'--the page will still load.

On the other hand, new stuff which happens to the page is not cached. IIRc, sombrowsers do cache normal JS/etc, but maybe not websockets/AJAX (not sure if thus)

So this is a browser issue, not an engine issue.

Update:

I'm quite sure the realtime updates work on a "push a new change as it comes along" system. To fix your , the behaviour will need to be changed to "push the 'new changes' list every xyz seconds", or "AJAX-fetch the question list on page load". Both solutions blow up bandwidth (former more than the latter), and the latter is just redundant.


Update2: OK, there is a server-side cache issue. Can has fix?

9
  • 1
    No. I just proved it's a server cache: go here and wait for "1 question with.." to appear.Click it. Refresh the page with F5 and... question is gone! Commented May 2, 2012 at 8:04
  • @Sha then it's both, since I've noticed(and just reproed) this problem when two tabs are open simultaneously--one refreshed and one 'back'ed--if I wait long enough before f5/back-ing, then the f5d page is OK, but the backed page lacks a question. Commented May 2, 2012 at 8:13
  • @Manishearth: I realize that the browser loads the page from cache in its original state. If I just had to wait for Question B to reappear, I wouldn't have tagged my question [bug]. But Question B going to limbo isn't expected behavior.
    – Dennis
    Commented May 2, 2012 at 14:07
  • @Dennis I would expect this behaviour--the websockets will push new questions as they come. It won't compare the question feed with what questions are already there (Educated guess on my behalf) . So that's supposed to happen. It still is a sort of [bug]/[feature-request] hybrid though--the only way to fix this is to change the behaviour of the live refresh to push the entire feed every xyz seconds. That will be a lot of extra bandwidth wasted. Commented May 2, 2012 at 14:15
  • @Manishearth: I admit that I don't know enough about websockets to fully comprehend the situation. That's why I didn't want to tag it [feature-request], since I cannot actually propose a solution or behavior. But there must be some way to save Question B from an eternity in limbo...
    – Dennis
    Commented May 2, 2012 at 14:19
  • @Dennis I don't understand websockets much either, but I'm quite sure that this must be the implementation, since the alternatives (listed above) are bloat-y without any payback(except cache). To save the question, refresh. I know it's annoying, but supporting browser cache will be extremely bloat-y, IMO. I can write a Chrome extension that may fix this by hijacking your "back" button and adding a randomness tail on SE pages, but I'm not sure--never written one before. Commented May 2, 2012 at 14:26
  • @Manishearth: Maybe there's a way to store the current state locally.
    – Dennis
    Commented May 2, 2012 at 14:31
  • @Dennis interesting, though that still complicates stuff Commented May 2, 2012 at 14:46
  • "new stuff which happens to the page is not cached." - okay, but if you do something that actively needs to communicate with the server (e.g. vote on something or edit a comment) surely it should make an AJAX request at that point, and refresh the page contents? Or at least the relevant portion? I have found that it doesn't work for editing comments, for example - the edit field will populate with the browser-cached comment, not the one currently on the server. Commented Feb 14, 2023 at 19:45

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .