#513 start.fp.o does not instruct the browser to avoid caching the page
Closed: Fixed None Opened 9 years ago by sgallagh.

I went to start.fedoraproject.org today (Jan 30) using Chrome 40 and was greeted by a page showing the Magazine entries from Jan 27 (the last time I had visited).

It appears that there is no cache-configuration in the HTML of the page instructing the browser to refresh its cache to get the new articles. Seeing as how the magazine posts are a primary feature of Start, I think it makes sense to adjust this.


Just a few things to this task:
we should try to avoid overload of the magazine (png files are loaded directly)
not all the page should be uncached, just the script (the template)
avoid META instructions
we build start.fpo hourly, so probably the best would be to use a time instruction to make the cache outdated. Maybe max-age or s-maxage could do this:

''Cache-Control: max-age=3600, must-revalidate''

Just a thought, needs testing before pushing it to production. Do we have any stats for workload of fedmag?

Meta tags should work pretty well. Something like this

{{{
<meta http-equiv="Cache-Control" content="no-cache, no-store, must-revalidate"/>
<meta http-equiv="Pragma" content="no-cache"/>
<meta http-equiv="Expires" content="3600"/>
}}}

Another option would be ditching the server-side magazine fetching completely. You could also simply fetch the feed for each user through Javascript. This would increase the load on fmag, though.

Robert, fmag gets around 3000 views daily.

Yes, the first line is similar to what I said, but I don't want to do any kind of caching. We can cache the part of the magazine feed for an hour, not "no-cache" and "no-store". Within an hour the content will not change.

Pragma = no-cache will not work, it could work for some browsers and cachings but most of the time it would be useless. That's what I meant with leaving away this instruction.

Expiring is ok with 3600, so we could use my single line, right?

For the stats I meant the data we are transferring from fedmag. I'm not worried about visitors, as we don't care about the magazine visitors. We should care about the load on the server we provide to fedmag, because we are recalling 5 small images at every pageload if we don't cache anything. That's why I said, let's cache the page normally, and let's make expire the cache for the magfeed.html template after one hour.

Hi,

This was caused by our cache headers saying browsers could cache for up to 5 days.
I just modified this to 2 hours, so that we at least get some caching, but the impact will not be as big, since we're only rebuilding hourly.

Thanks for reporting this issue.

Login to comment on this ticket.

Metadata