Reputation: 103
I'm using Gatsby on my website and PageSpeed Insights report keeps reporting /s/fs.js
from edge.fullstory.com
as a cache issue or an unused script issue (on some pages). As I understand that is because I'm using gatsby-plugin-fullstory, and since it is a 3rd party plugin I can't control the cache, and I don't want to self-host the plugin.
How can I resolve this issue?
Upvotes: 0
Views: 118
Reputation: 46040
PageSpeed Insights suggest improvements that may make a difference.
Caching assets needed by the page is a best practice to avoid them having to be refetched from the server for each page load.
However, in some cases that does NOT make sense to do. Particularly for analytics services where you explicitly WANT them to be called for each page load. Google Analytics and gatsby-plugin-fullstory fall into this category.
PSI is an automated scan that does an incredible job of giving advice for any URL plugged into it. But that does not mean it is completely infallible or that it's advice MUST be followed. In this case the advice is not relevant and can (and in fact should!) be ignored for this particular resource. In fact, this audit is under the "Diagnostic" sections showing it's something that it has diagnosed as a potential problem, rather than definitely an actual problem.
Note that if the rest of the site has a decent caching policy then these outliers are often not flagged by PSI, so the fact they are being flagged for your site, suggests that perhaps you have other assets that could have improved caching settings. If you fix those, then maybe these will stop flagging? But either way take the "Diagnostics" as potential improvements, rather than something that MUST be done.
Upvotes: 1