4 ms·
Hi Greg, Thanks for your response here. I think we'll just have to agree to disagree on a number of points, but there's a few I would like to comment on:
by technion 9y ago
Hi Greg,
Thanks for your response here. I think we'll just have to agree to disagree on a number of points, but there's a few I would like to comment on:
If the page is loaded from the AMP cache, which is probably the common case, the file has a 1 year expiration.
As per the screenshot, Google Pagespeed appears to disagree. Looking at the headers via curl, I see "expires" with the current date and time (ie, it's already expired), a max-age tag of 50 minutes. I'm not seeing one year anywhere.
If the 30 day stale-while-revalidate really invalidates those two headers, and I'm not knee-deep in browser support enough to really know, can someone at Pagespeed please consider this a bug?
The issue has come up a number of times on various forums over the years in relation to the vanilla analytics.js, and the answer that's usually accepted is "just self host the Javascript". I'm calling it now - people will start doing this with AMP scripts if Pagespeed doesn't change the warning, regardless of the consequences.
trick works by refetching the document using an XHR which only works in certain CORS environments. I'm not sure how else to do this.
Thanks for explaining that. It makes sense in a way I don't see another way of doing it - but the AMP website[0] suggests this should "just work". If it in fact only works "in certain CORS environments", what I'm hearing is that most people testing these AMP sites just have those environments and assume everyone else does. Which may be concerning from a security point of view.
[0] https://www.ampproject.org/docs/tutorials/create/preview_and_validate https://www.ampproject.org/docs/tutorials/create/preview_and...
- gregable 9y ago> Looking at the headers via curl, I see "expires" with the current date and time (ie, it's already expired), a max-age tag of 50 minutes. I'm not seeing one year anywhere. Take a look at the version of the doc which is served from the AMP cache: https://cdn.ampproject.org/c/s/lolware.net/2017/07/04/amp-bloat.html https://cdn.ampproject.org/c/s/lolware.net/2017/07/04/amp-bl... I like to think of PageSpeed Insights like the output of a good linter. No linter is or can be perfect. The issues reported are good things to consider and are correct for the majority of times that they trigger, but not in all cases. This is one of those cases. > CORS The best fix here might be a more useful response in the dev console. Plenty of sites, especially on dev servers, don't have any CORS headers at all, so this does work in those cases. I'd still recommend one of the other validation methods which work fine with any CORS setup.