CloudFlare CDN + Drupal

16
Drupal Meetup

Transcript of CloudFlare CDN + Drupal

Page 1: CloudFlare CDN + Drupal

Drupal Meetup

Page 2: CloudFlare CDN + Drupal

CloudFlare CDN + DrupalAdding shielding to your site.

Page 3: CloudFlare CDN + Drupal

What is a CDN? Why do I care?CDN stands for Content Delivery NetworkIts a set of servers around the world that can deliver static and dynamic content (e.g. pages and images/docs/css/js)Allows you to serve users from the server closest to them.It’s a proxy that offloads traffic from your web server.Can protect against DDOS attacks or slash-dotting.

Page 4: CloudFlare CDN + Drupal

Where do I get a CDNThere are a couple of Major CDN providersAkamaiCloudFlareFastlyAWS CloudEdge

Page 5: CloudFlare CDN + Drupal

CDN

Web Server

CDN Request FlowBrowser

Drupal

Page 6: CloudFlare CDN + Drupal

Cache MissAdams-MacBook-Air:atfgov adam.weingarten$ curl -SLIXGET https://adam.weingarten.me/testHTTP/1.1 200 OKServer: cloudflare-nginxDate: Mon, 08 Feb 2016 22:55:49 GMTContent-Type: text/html; charset=UTF-8Transfer-Encoding: chunkedConnection: keep-aliveSet-Cookie: __cfduid=d7657b605a462d6936d87c9fc333c7d3e1454972149; expires=Tue, 07-Feb-17 22:55:49 GMT; path=/; domain=.weingarten.me; HttpOnlyCache-Control: public, max-age=86400Content-language: enExpires: Tue, 09 Feb 2016 22:55:49 GMTLink: </test&gt; rel="revision"Vary: Accept-EncodingX-Varnish: 3562937547CF-Cache-Status: MissStrict-Transport-Security: max-age=15552000; preload

Page 7: CloudFlare CDN + Drupal

Cache HitAdams-MacBook-Air:atfgov adam.weingarten$ curl -SLIXGET https://adam.weingarten.me/testHTTP/1.1 200 OKServer: cloudflare-nginxDate: Mon, 08 Feb 2016 22:55:49 GMTContent-Type: text/html; charset=UTF-8Transfer-Encoding: chunkedConnection: keep-aliveSet-Cookie: __cfduid=d7657b605a462d6936d87c9fc333c7d3e1454972149; expires=Tue, 07-Feb-17 22:55:49 GMT; path=/; domain=.weingarten.me; HttpOnlyCache-Control: public, max-age=86400Content-language: enExpires: Tue, 09 Feb 2016 22:55:49 GMTLink: </test&gt; rel="revision"Vary: Accept-EncodingX-Varnish: 3562937547CF-Cache-Status: HITStrict-Transport-Security: max-age=15552000; preload

Page 8: CloudFlare CDN + Drupal

CDNs are servers why do we need a module?

CDN is a cache. Getting something into cache is easy. Getting it out at the right time? Not so much.CloudFlare Module on D8 Helps purge content automatically. When you update content you want users to see those updates now not 24 hours later.

Page 9: CloudFlare CDN + Drupal

Enter CloudFlare on D8

Page 10: CloudFlare CDN + Drupal

CloudFlare + Purge = Best Friends

Page 11: CloudFlare CDN + Drupal

Purge in D8: Plugin ArchitectureYou can create plugins with quality of service.Checks that system is in a purgeable stateIt will check that everything worked if not re-queue.It can work with other plugins (varnish is in the works ;) You can create different queuers, runners.

Page 12: CloudFlare CDN + Drupal

Cache Tags in D8Groupings for pages and content.Let’s say you have a block “wally” that appears on 10 pages those 10 pages get the tagYou update the block “wally” everything with the tag of wally gets purged. https://www.drupal.org/developing/api/8/cache/tags

Page 13: CloudFlare CDN + Drupal

CaveatsCloudFlare’s Api only supports 200 tag purges/dayVarnish support in varnish isn’t there yet. Need to wait till end of Q2Varnish VCL’s may need to be updated to support purging of tags

Page 14: CloudFlare CDN + Drupal

Want to contribute?https://www.drupal.org/project/cloudflare https://www.drupal.org/project/purge

Page 15: CloudFlare CDN + Drupal

Questions?D8 Trivia?CDNs?

Page 16: CloudFlare CDN + Drupal

Thank you