2.1.4 • Published 6 years ago

mister-gold-cdn v2.1.4

Weekly downloads
2
License
MIT
Repository
github
Last release
6 years ago

mister-gold-cdn

Static resources (css, js, etc.) from Mister Gold blog.

mister-gold-cdn npm mister-gold-cdn Downloads

NPM

Introduction

The idea of having a detached location (a repository) with static files is based on separating requests when loading a website. In other words, it is better to have 5 different places for loading resources from, rather than just one place that holds all the resources.

When there is only one place that holds all the resources, the requests go consecutively in queue, which means that it is impossible to load a specific resource, until all the preceding requests are loaded. When there are multiple locations, the requests can go in parallel, without blocking each other, which reduces the time taken to load the whole site. As research show, the average load time can be reduced up to 30-50%.

Solution

This solution uses GitHub repository to store the static files that are published as a npm package and then distributed via jsDelivr Content Delivery Network. The links to the distributed files are added to the template files of my blog, where they are actually called from. To make the CDN even more efficient and decrease the number of concurrent requests, all non-critical files were combined into one. Furthermore, I used subsetting for resources like FontAwesome to get rid of excessive (and unused) portions of code.

Results

These results were received on my personal blog that is powered by Pelican Static Site Generator and hosted on GitLab Pages.

ParameterBeforeAfterProfit
number of requests129 (can be further decreased to 7)25%
load time1.66 s366 ms78%
page size143.3 Kb88.8 Kb38%
performance grade86927%

I assume that the same (or even greater) results can be acheived on other SSG (e.g. Jekyll, Hugo or Hexo) or CMS (e.g. WordPress), because there are bunch of files that can be easily combined and distributed over a CDN.

Contribution

The implemetation of my "static network" is stupidly simple and I suppose it is not as great as it could be, so if there are some better, more efficient or elegant approaches, your ideas are welcome and appreciated! Feel free to create an issue and share your thoughts. Let's do some cool stuff together!

2.1.4

6 years ago

2.1.3

7 years ago

2.1.2

7 years ago

2.1.1

7 years ago

2.1.0

7 years ago

2.0.7

7 years ago

2.0.6

7 years ago

2.0.5

7 years ago

2.0.4

7 years ago

2.0.3

7 years ago

2.0.2

7 years ago

2.0.1

7 years ago

2.0.0

7 years ago

1.0.8

7 years ago

1.0.7

7 years ago

1.0.6

7 years ago

1.0.5

7 years ago

1.0.4

7 years ago

1.0.3

7 years ago

1.0.1

7 years ago

1.0.0

7 years ago