25 millions #176
FranckFreiburger
started this conversation in
blog
25 millions
#176
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
While casually exploring the various usage statistics of vue3-sfc-loader, I was pleasantly surprised to discover that vue3-sfc-loader is being downloaded (directly or indirectly) nearly 2 millions times per month on the jsdelivr CDN and almost 25 millions times over the course of the year 2023. Additionally, jsdelivr activates a
Cache-Control max-age=31536000
. This implies that vue3-sfc-loader is executed even more frequently!This revelation fills me with joy, enthusiasm, and questions.
Repetitive client-side compilation of the same source file is a significant waste of CPU cycles (i.e., energy and time) because it is a task performed numerous times without tangible benefit.
While vue3-sfc-loader already incorporates a mechanism for caching compiled sources, I believe it is vastly underutilized.
Hence, I propose the implementation of a basic client-side caching system for vue3-sfc-loader compiled assets.
Implementing this will, initially, prevent the repeated compilation of the same file for a same user. I'm thinking about an identical mechanism on the server side (see #178).
See implementation here: #175
Usage:
just add
compiledCache: new CompileCache()
in your vue3-sfc-loader options like this:Beta Was this translation helpful? Give feedback.
All reactions