- Cloudflare CDN integration with WordPress
- w3 total cache
I tried with the keycdn free trial as 25GB free traffic 1 month with a credit of 1$ in few while ago.
How to integrate with CDN in WordPress?
You can install a CDN enabler plugin in WordPress by Keycdn. and enter the CDN URL there in the field of CDN URL.
create a pull zone and enter your website url. then CDN URL will be displayed just copy that paste at your WordPress dashboard relative path.
in automize plugin replace on the CDN base URL //cdn.example.com/.
Push one is different we have to upload the content to CDN directly.
We can also integrate CDN with auto optimize and wp super cache and w3 total cache.
Their CDN costs 0.04$ for 1 GB, but google CDN pricing costs 0.10-0.20$, Akamai CDN Microsoft’s. Max CDN
Cloudflare offers also free trials but someone needs to call you after filling the contact form.
Two main reasons Use CDN
- Increase page speed
- Lower the server costs.
let me skip about CDN for images, videos. now I am writing about CDN Deliver for CSS & JS files.
There is JSdevier plugin called in WordPress. deliver a free open source platform.
Hosting CSS and js at google drive, dropbox and google app engine works for small custom made websites.
Cloudflare CDN caching
is CloudFlare cache really working? if we enable CloudFlare caching as 3 options no query string, query string, and standard.
In google page speed insights didn’t display external CSS or js resource. but some time GT Metrix did that.
CloudFlare doesn’t integrate with auto optimize. because the base URL of CloudFlare CDN not identical. I have test CloudFlare caching again perfectly with another website.
Amazon CloudFront and google cloud CDN are bit costly when compared to other CDN providers.
CloudFlare speed settings>> auto minify js, CSS, HTML check this.
Rocket loader functionality: loads JS automatically.
How to turn off Cloudflare caching?
create a page rule enter your domain as website.com/* wildcard applicable all pages start with.
select bypass cache.
How to enable google CDN?
google Load balancer is must be activated before adding cdn in google cloud compute engine. the load balancer also has some pricing.
Combining all external sources into one done by autoptimize rather w3tc.
|CDN Provider||Cost per GB|
|//need to buy server|
$20 -200 months
|Prices are just indicative, these changes upon packages, discounts etc.
NOTE: Ameria cheap, Asia High,
Africa too High.
Here I am mentioning Asia Server price
How to Implement SelfHosted CDN WitH WordPress?
You know just look at these resources
are 26 static components that are not on CDN.
WordPress is bloated with other plugin sources.
1st We have to Set a Subdomain.
cdn.maindomain,com Points Maindomain.com as CNAME Record Not A record.
Next step Adjsutig root document for the subdomain to main domain directory (works as a generic mirror).
Set Cookie Domain
you can set the cookie domain to only your non-static domain to prevent WordPress cookies from being sent with each request to static content on your subdomain.
define( ‘COOKIE_DOMAIN’, ‘www.example.com’ );
2nd step Using Plugin W3 Total cache:
- CDN feature on in the General Settings section and select Generic Mirror in the CDN Type
- W3 Total Cache’s CDN settings
- static files such as image attachments, theme files, CSS and JS files
4.W3 Total Cache’s CDN settings and click on Modify Attachment URLs
W3 Supercache same Process applies.
Reduces the latency(fast speed) involved in serving assets, (faster speed) But More TCP connections /DNS Lookups (Slow speed). (one extra addition to your ads (Adsense), etc)
with SSL V3 multiplexing, there are No more TCP COnnection all resources pushed into one request which is big size.
self-hosted CDN not equal to real CDN.