You’re thinking about another known issue, but this isn’t that one.
One important point that browser will open the /reviews page completely from the cache without making any new network requests. As it was loaded before. So correctly answered questions would actually reappear because the page was loaded from cache as it was loaded from the server before the browser was closed.
If I would hit Ctrl+F5 correctly answered questions would indeed disappear, but I’m not sure all Bunpro users are so tech-savvy to make sure they purged their cache.
That happens because /reviews page always have the same ETag, so browser may show the page from the user’s cache. Your Cache-Control header suggests that browser must revalidate the page, but ETag happens to be the same. So browser just shows the page from cache. And all API requests are loaded from cache as well but without revalidating them. So all reviews reappears, because /api/frontend/reviews is loaded from cache too.
And if I answer the same review again, its SRS level bumps twice.
You could fix the issue by adding no-store
directive to Cache-Control
header on the api/frontend/reviews
endpoint and removing ETag from there to make sure browser will never cache this API call, but it’d be nice also to add a sanity check to the /api/frontend/.../update
endpoint. If user sends an update for a review before next_review
time, then it’s obviously a cache issue. Just don’t update review in this case and return current review data.