Answer the question
In order to leave comments, you need to log in
Is it correct in my case to use JS from CDN Cloudflare?
Hello. Recently I decided to optimize my blog and install the HTTPS protocol. Found a free option with Cloudflare. It seems that everything suits and there are many useful features. I set caching for JS, CSS, IMG files, etc. and when it came to JS, I remembered that Cloudflare has its own CDN.
This raises the question, why don't I use, for example, the jQuery library from Cloudflare CDN, given that I have DNS from Cloudflare and caching from this service is worth it. After all, there is a possibility that the user visited some site and the browser once already cached the link
//cdnjs.cloudflare.com/ajax/libs/jquery/2.1.2/jquery.min.js
. Yes, there are doubts about the specific version, but nevertheless, would it be correct?Answer the question
In order to leave comments, you need to log in
Yes, but what could be wrong here? The idea of using a CDN is not quite new and has been worked out for years. The likelihood that a browser has visited a CDN is much higher than that a browser has visited your site. Therefore, CDNs are by definition more advantageous in 99% of cases where they can be applied. I can also recommend Google as a CDN service .
PS It is not possible to use CDN everywhere and not always, for example, on one project, scripts and CSS were generated/compiled/compressed dynamically (along with libraries and into one script), for example. there were a lot of them and it was not possible to upload everything at once to the browser. For everything else, CDN is a pretty good choice.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question