开发者

Can we detect if a site is on CDN?

开发者 https://www.devze.com 2023-01-15 16:42 出处:网络
Is there a way to detect if a site is开发者_如何学Python on a Content Delivery Network and if yes, can we tell which service are they using?A method that is achievable from the command line is using t

Is there a way to detect if a site is开发者_如何学Python on a Content Delivery Network and if yes, can we tell which service are they using?


A method that is achievable from the command line is using the 'host' command, with the -a flag set to see the DNS record e.g.

host -a www.visitbritain.com

Returns:

www.visitbritain.com.   0   IN  CNAME   d18sjq5nyxcof4.cloudfront.net.

Here you can see that the CNAME entry tells us that the site is using cloudfront as the CDN.


Just take a look at the urls of the images (and other media) of the site. Reverse lookup IP's of the hostnames you see there and you will see who own them.


I built this little tool to identify the CDN used by a site or a domain, feel free to try it.

The URL: http://www.whatsmycdn.com/


You might also be able to tell from the HTTP headers of the media if the URL doesn't give it away. For example, media served by SimpleCDN has Server: SimpleCDN 5.6a4 in its headers.


cdn planet now have their cdn finder tool on github http://www.cdnplanet.com/blog/better-cdn-finder/ The tool installs on the command line and allows you the feed in host names and check if they use a CDN.


If Website using GCP CDN you simply check it using curl

curl -I <https://site url>

In reponse you can find following headers there available

x-goog-metageneration: 2
x-goog-stored-content-encoding: identity
x-goog-stored-content-length: 17393
x-goog-meta-object-id: 11602
x-goog-meta-source-id: 013dea516b21eedfd422a05b96e2c3e4
x-goog-meta-file-hash: cf3690283997e18819b224c6c094f26c


Yes you can find by

host -a www.website.com


Apart from some excellent answers already posted here which include some direct methods which may or may not work for all the websites out there, there is also an indirect way to see if a CDN is there. And especially if its your own website and you want to know if you are getting what you are paying for !

The promise of a CDN is that connections from your users are terminated closer to them so that they get less TCP / TLS connection establishment overhead and static content is cached closet to them so that it loads faster, puts less strain on your origin servers.

To verify this, you can take measurements of site load times across the globe and see if all the users get similar loads times. No you dont have to get a machine everywhere in the world to do that ! Someone has already done that for you

Head to https://prober.tech/ and the URL you wish to test for load times. Because this site itself is in Cloudflare's CDN, you can put that link itself in the test box and use it as baseline !

More information on using the tool can be found here

0

精彩评论

暂无评论...
验证码 换一张
取 消