5 ms·
They do provide proper cache headers. They cache the CSS for 1 day. The actual font files are cached for a lot longer than that. The reason for shorter cache p
by putlake 10y ago
They do provide proper cache headers. They cache the CSS for 1 day. The actual font files are cached for a lot longer than that.
The reason for shorter cache periods for CSS is that Google are continually making improvements. The font files are different e.g. for Mac vs Windows because they are optimized for platforms.
In general you will find that all URLs that are directly called from millions of websites (e.g. facebook SDK, Google Analytics snippet) have short TTLs. Makes sense when you think about it -- 3rd parties providing these resources need a way to stay agile and ship new versions without forcing millions of websites to upgrade their code.
- xaduha 10y ago> They do provide proper cache headers. They cache the CSS for 1 day. The actual font files are cached for a lot longer than that. I don't see it, not with curl at least. Looks like actual fonts are cached for a year. But not CSS, > curl https://fonts.googleapis.com/css?family=Open+Sans https://fonts.googleapis.com/css?family=Open+Sans -i expires:Tue, 14 Jun 2016 19:02:03 GMT date:Tue, 14 Jun 2016 19:02:03 GMT At the very least they should allow to control that with another query parameter.
- row1an 10y agoExpires is a HTTP/1.0 header, Cache-Control is HTTP/1.1 and used by anything created in the last 10-15 years. Most sites set the Expires header similar to their Cache-Control max-age, but I guess Google just doesn't care and it doesn't really matter anyway.