Static assets not being served through Cloudflare CDN - cdn

So I am new to gatsbyjs and CDN's. My website is hosted on a2hosting and is going through Cloudflare, but when run a test on GTmetrix it says these files aren't going through the CDN, what am I doing wrong?

It looks like you only set the NS-Record with CloudFlare, but your A-Record is still pointing to your hosting provider directly. You need to change that record to work with Cloudflare.
Check your records:https://bhnd.io/pixelfriendly.co.za/
Check the Cloudflare documentation:https://support.cloudflare.com/hc/en-us/articles/205195708-Changing-your-domain-nameservers-to-Cloudflare
If that doesn't help, I would recommend sending Cloudflare a support request, they probably have more insights and can tell you what's wrong.

Related

How to enable CDN for a subdomain with external web server?

My landing page is a static built website on Netlify.
Then I have a subdomain, which is an A record in DNS (set in Netlify).
This subdomain is points to an external web server (nginx+Django), which provides REST API and serves static content.
The question is how can I make this subdomain to use Netlify's CDN, when serving static content from Django API?
Are there any approaches to do it?
Netlify advises against using any CDN in front of it, as it already provides CDN. As well as there'll be a problem with SSL certificate.
I tried my best to look for such a question, but I couldn’t pick the right terms, I suppose, so I didn’t find it.
I would be very grateful for any advice!
Thank you and best regards!
You can use Netlify's Proxy Rewrites: https://docs.netlify.com/routing/redirects/rewrites-proxies/ to add some level of CDN to your site. However, it will totally be upto Netlify to decide how much time your content will stay in cache. If it's not in Netlify's cache, there won't be much of a performance boost by doing this - so I'd advise against it, unless absolutely necessary.

Cloudflare with WPRocket

So... I just created a new CDN through CF. I'd like to know how long does it take the DNS to propagate worldwide? I tried registering the CDN that I created in CF into WPRocket but it's breaking my site. I don't know if is because of the timeframe that I need to wait or that I'm doing something wrong within the crypto config in CF.
Generally cloudflare takes 24 hours to propogate dns records through wordwide. After that website will serve request through cloudflare. And issue of your site brokedown is may be minification of jQuery or css in wp-rocket or defer parsing of script. Also you can use http://whatsmydns.net for checking DNS entries.
You don't need to configure the CDN section in WP Rocket for services like cloudflare or sucuri.
There's an addon (activated inside WP Rocket) for cloudflare where you just need to fill in your API key and that's it.
I believe you don't even need to set the addon and the API key for cloudflare to work with your website and WP Rocket, the addon is "just" for controling cloudflare directly from wordpress dashboard (purge cloudflare cache, enable development mode, etc)

Cloudflare CDN doesnt work properly on Wordpress website

I set up to my wordpress website Cloudflare for CDN and security reasons.
Still all the content in my website comes from my domain. Everything looks fine. Changed the nameservers etc
When I inspect my elements all content is coming from mydomain.com/wp-content/blabla
Whats wrong?
This is expected. Since you actually setup your DNS records with CloudFlare, they serve resources from your domain. Resources should not come from CloudFlare's domain (even though they are being sent from CloudFlare servers). To verify that this is actually the case, the article below shows how to use webpagetest.org to verify that the cf-cache header is provided in the response.
https://support.cloudflare.com/hc/en-us/articles/200169556-How-can-I-tell-if-Cloudflare-is-caching-my-site-or-a-specific-file-

Host complete WordPress website in Amazon CloudFront or any other CDN

What I would like to do
According to a Amazon Senior Architect to whom I spoke recently, it is possible to cache dynamic website content in Amazon CloudFront.
The way I understand how this could work, is that in addition to doing a page cache of each page which has been accessed, cache the page in CloudFront too.
What I have tried
I have experimented a lot with W3 Total Cache and its settings but did not find a solution to this problem. I also have tried to set up CloudFront directly in the AWS control panel but did not find a way to cache the static result (html?) of WordPress's php calls.
Question
How would you tackle the issue?
How can I cache a static version of WordPress's dynamic pages in CloudFront or any other CDN?
Here is a concept plugin which aims to do this:
https://github.com/PeterBooker/wp-cloudfront-helper
most CDNs advertise that they can cache dynamic web sites. Unless they have very specific information about the pages they need to serve, they can't. There are situations where the "penalty" of a CDN for a dynamic page isn't that bad, but having an additional hop in-between the web server and the end user can only be faster in some very specific situations. The main reason is the absense of a Last-Modified header for the generated pages.
From my experience working with (at) CDN providers, the most performant way to include a CDN is to use a different hostname for the static assets and point that hostname to the CDN with your web server as the origin server.
Jan

Piwik not tracking on www

I have a website that uses CDN. The 'www' is on CDN, while the normal website http://example.com can be directly accessed from the webserver. The CDN(http://www.example.com) uses origin pull to get content from http://example.com
Now, when I access http://example.com directly, I can see entries in Piwik, however, it's not working when I access http://www.example.com. Is there something extra that I should be doing here?
Please note that the piwik is not hosted on the same server. I guess the server issue is not a problem, as it works when accessed directly (http://example.com)
I am using the technique which doesn't reveal the Piwik Server URL. (http://piwik.org/faq/how-to/#faq_132)
Thanks.
You need to add both example.com and www.example.com to URLs in your Websites Management on piwik side.
Check with Firebug to see if the request is made to Piwik on your www. ?

Resources