1

I was reading once that the Stack Exchange sites are using caching heavily.

Checking the HTML source of a site, when logged-in and when being an anonymous visitor, shows in both cases (example):

<div class="user-action-time">
    asked <span title="2019-08-11 16:43:43Z" class="relativetime">3 mins ago</span>
</div>

Obviously the "3 mins ago" part is rendered serverside, which means from my perspective, that it is not cached.

Do I misunderstand the "caching mechanism"? Maybe different parts of the site are cached and put together? I see caching as a fixed information, not a newly generated piece of information.

  • In the latest blog of Nick Craver he says that they are no longer using ASP.NET output caching. so Q/A content comes now from the database on every fetch. Other bits are still cached. – rene Aug 11 at 17:23
  • "3 mins ago" does (also!) come from the full.en.js which calls a function updateRelativeDates on load and then every 60 seconds to update that text inside of the span. In that function it calcs relative time that based on the timestamp in the title attribute. – rene Aug 11 at 17:46
1

The timestamp of posts is indeed not cached.

It's taken "live" once when the page loads, then as rene says the timestamp value updates every 60 seconds.

You must log in to answer this question.

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