Skip to content

Large libraries: use common CDNs or purge unused code? #518

Answered by patrickhulce
artoonie asked this question in Q&A
Discussion options

You must be logged in to vote

Is it better to assume users have downloaded and cached common CDN-hosted files

In practice this is not an assumption that is true. In fact, browsers by now are moving to a double-keyed cache where no CDN assets are shared between sites at all, even if the user had the unlikely exact combination of library versions from the same CDN as another recently visited site.

Also worth noting a significant portion of the cost isn't just downloading a large JS library, but in parsing and initial evaluation as well which does not receive the same benefits of the network disk cache.

does lighthouse always show the worst-case scenario with no cache?

It shows the no cache performance by default. --…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@artoonie
Comment options

Answer selected by artoonie
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants