Please upgrade here. These earlier versions are no longer being updated and have security issues.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.
Discussion timestamps - are they working right?
judgej
✭
This is something I notice on this site - the timestamps provided by Vanilla to tell the browser whether a page has changed, are likely not working.
Here is what I see:
I bring up a discussion, and that discussion page gets cached by my browser with a timestamp. I then post to that discussion, which uses AJAX and does not refresh the page.
I can then shut down my browser and optionally my whole system. When I relaunch the browser, it attempts to load up the same pages again, which includes the discussion I just posted to. What happens is that my browser sends the timestamp it had originally stored against the page to Vanilla, and Vanilla says "nothing has changed" and my browser then displays the local cached version.
However, that is wrong - something *has* changed. The post I made in the previous browser session should have updated the timestamp of the discussion page on the server, and I should be sent a new version of that page.
I have not looked into the HTTP details yet, but I am confident it is not the browser that is at fault, because it does successfully get updated pages from other sites and other forum software when I start the browser up, but also uses the local cached versions where appropriate. This *only* happens to me on this Vanilla website.
tl;dr - when closing a browser window with multiple tabs in, and relaunching the browser, posts that had previously been posted to Vanilla in open tabs do not get displayed. Vanilla is sending "not changed" HTTP responses inappropriately, presumably because it is checking the wrong timestamps, or the timestamps of the discussion are not being updated correctly when posts are mode.
Has anybody else noticed this?
-- Jason
Here is what I see:
I bring up a discussion, and that discussion page gets cached by my browser with a timestamp. I then post to that discussion, which uses AJAX and does not refresh the page.
I can then shut down my browser and optionally my whole system. When I relaunch the browser, it attempts to load up the same pages again, which includes the discussion I just posted to. What happens is that my browser sends the timestamp it had originally stored against the page to Vanilla, and Vanilla says "nothing has changed" and my browser then displays the local cached version.
However, that is wrong - something *has* changed. The post I made in the previous browser session should have updated the timestamp of the discussion page on the server, and I should be sent a new version of that page.
I have not looked into the HTTP details yet, but I am confident it is not the browser that is at fault, because it does successfully get updated pages from other sites and other forum software when I start the browser up, but also uses the local cached versions where appropriate. This *only* happens to me on this Vanilla website.
tl;dr - when closing a browser window with multiple tabs in, and relaunching the browser, posts that had previously been posted to Vanilla in open tabs do not get displayed. Vanilla is sending "not changed" HTTP responses inappropriately, presumably because it is checking the wrong timestamps, or the timestamps of the discussion are not being updated correctly when posts are mode.
Has anybody else noticed this?
-- Jason
1
Comments
I can see at least three different places in the code where "HTTP/1.0 304 Not Modified" headers are returned. I don't know where they all get their dates from. I assume the dates would need to come from different places, depending on whether displaying a comment, a discussion, a category etc. or even if a module or plugin has decided that the page should not be cached for one reason or another.
It is always a hard thing to do, because a certain amount of work needs to be done to determine what the date is of a page (i.e. the controller needs to be able to dig deep enough into what it will be displaying in order to find out when that thing being displayed last changed), and the idea is to minimise that work, as well as being able to tell the browser the page has not changed and so reduce the network traffic.