You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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).
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
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