SlideShare une entreprise Scribd logo
1  sur  27
Télécharger pour lire hors ligne
Sven Härtwig – narf-studios GmbH | nine.ch techtalk | 2020-02-25
CLOUDFLARE
Why we love it
About me
Sven Härtwig

CEO – narf-studios GmbH
About narf-studios
Digital agency with a strong technical focus.

Based in Hamburg.

Specialized in E-Commerce projects with Magento.

www.narf-studios.de
About apfelkiste.ch
One of the TOP 30 Online shops in Switzerland.

Currently more than 25'000 unique products on stock.



Up to over 9 million pageviews a month.

Always fast growing in new products and traffic.

On Cloudflare for 5 years now.
Problems
• get out of the line of fire of potential attacks (DDoS / other attacks)

• Speed. We need more speed!

• Optimize processes

• Reduce workload of the webservers
In this example all the traffic coming to the subdomain shop is being routed through the cloudflare proxy.

The IP of our origin server is now hidden from the internet by cloudflare. Do this with a new IP address!



An attacker does not know the IP address of the actual origin server and puts all his effort to ... 

the protection of Cloudflare.
In the line of fire!
DNS Obfuscation
Cloudflare protects the infrastructure from a DDoS attack with a global capacity of 59 Tbps (7,375 TB/s). 

Should be enough.

Cloudflare can manage most of the incoming common threats. (DDoS, known exploits, Rate limiting)



Nothing is secure by 100%! Things like XSS are still vulnerable!

You have to secure your application (anyway)



... by firewall rules

... by always remembering the existence of murphy's law when developing your application

... by avoiding doing stupid things
In the line of fire!
Protection (DDoS / WAF)
In the line of fire!
Firewall
Cloudflare offers rulesets (managed rules) for different web applications which can 

be turned on with one click and keeps you safe for a lot of known attacks related to your software
Speed!
At first there is the slowness
Old setup – before we knew nine ;)

• (poor configured) Varnish as caching layer

• no CDN at all. Followed by a CDN provider which latency was worse than without a CDN.

• no optimized processes.
Speed!
What does slow mean to an ecommerce business?
Why speed matters!
• Users hate a slow website. If it is too slow ... they are gone. 

This means: YOU are losing money!

• Search Engines are creating a score of your website. 

The speed is an important criterion for your ranking.

This means: less traffic / higher costs to get traffic and this means: YOU are losing money!

• Each improvement in speed performance matters and enables your users to access your website more
quickly or even at all (think of mobile users sitting in a train).

This means: YOU are earning more money!
Speed!
With Cloudflare in front
Speed!
Together with nine we put cloudflare in front of our setup.

Result: 

• a fully working full page cache (FPC) with a CDN for all assets which can be handled really easy

• no VCL configuration needed. Only pagerules are needed which can be set up on the CF
dashboard very easy.
With Cloudflare in front
Speed!
Speed!
How cloudflare helped us so far
• Very low latency for dns lookups and response times for content (if located in the edge cache)

• The edge cache of Cloudflare.
Speed!
Some speed optimization tools CF offers
• Auto minify

HTML / CSS / JS can be minified by CF.

• Polish

Reduces the image size by removing metadata and applies compression (lossless, lossy, webp) if
configured to.

• Brotli (compression)

• HTTP2 Priorization / TCP Turbo / Rocket Loader / Railgun / prefetch

• Mirage (beta)

• AMP Real URL
Speed!
Pagerules + the edge cache
• Every asset / route (GET Requests) can be stored in the edge cache configured by a pagerule.

• It is easy to purge the caches either on the dashboard or by using the API. 

Possible ways:



URL = https://www.narf.it/product.html || https://www.narf.it (for purging only the homepage)



Hostname = www.narf.it 



tag = products



prefix = css (purge all cache objects contained by the folder or url segment "css". narf.it/css/*
recursively)



Or just purge all!
Speed!
A simple pagerule
This simple rule would cache all .html docs for all subdomains of narf.it for 7 days in the CF edge cache.
Speed!
What you can do with pagerules
CF offers you a lot of possibilities you can combine.
Most used use cases for pagerules are:

• cache rules

• do not cache rules which override previously defined caching rules

• more specific caching rules for assets

(for example: higher edge / browser cache ttl for image files which never
change => also improves the performance)

• 30x forwardings based on routes
Speed!
Problems with purging the caches.
Purging cache objects by URL is okay... but not if you have to purge thousands of unique URLs.
Each purge API request is limited to 30 entries. 

This may lead to a very time consuming process which can take ages.
Purging all CF cache nodes may take up to 30 seconds.
Speed!
A better purging process
Purging by URL
ladekabel/kabel.html

apple/kabel.html

zubehor/kabel.html
Purging by tag
ladekabel/kabel.html

apple/kabel.html

zubehor/kabel.html
Hey CF. Please purge:



url: ladekabel/kabel.html,

url: apple/kabel.html,

url: zubehor/kabel.html
Hey CF. Please purge:



tag: kabel
add cache tag to all
URLs: kabel
}
done by the application
with a response header
Workers
What is it good for?
Cloudflare Workers provide a serverless execution environment based on javascript.

Some things a worker can do:
• change requests and responses

• fetch / send data from / to other origins or our webserver in the background

• store and use limited data as environment variable

• replace html without purging caches
Workers
Change requests and responses
Workers
Change requests and responses
Workers
The FPC, I have to change data situation
Workers
The FPC + AJAX situation
Workers
Let CF workers do this
Workers
But wait ... we want more speed!
Thank you
Any questions?

Contenu connexe

Tendances

Implementing Advanced Caching and Replication Techniques in ...
Implementing Advanced Caching and Replication Techniques in ...Implementing Advanced Caching and Replication Techniques in ...
Implementing Advanced Caching and Replication Techniques in ...
webhostingguy
 
Web Hosting - What is it?
Web Hosting - What is it?Web Hosting - What is it?
Web Hosting - What is it?
webhostingguy
 

Tendances (20)

Dynamic Content Acceleration: Lightning Fast Web Apps with Amazon CloudFront ...
Dynamic Content Acceleration: Lightning Fast Web Apps with Amazon CloudFront ...Dynamic Content Acceleration: Lightning Fast Web Apps with Amazon CloudFront ...
Dynamic Content Acceleration: Lightning Fast Web Apps with Amazon CloudFront ...
 
Dynamic Content Acceleration: Amazon CloudFront and Amazon Route 53 (ARC309) ...
Dynamic Content Acceleration: Amazon CloudFront and Amazon Route 53 (ARC309) ...Dynamic Content Acceleration: Amazon CloudFront and Amazon Route 53 (ARC309) ...
Dynamic Content Acceleration: Amazon CloudFront and Amazon Route 53 (ARC309) ...
 
Content Delivery Network - CDN
Content Delivery Network - CDNContent Delivery Network - CDN
Content Delivery Network - CDN
 
Measuring CDN performance and why you're doing it wrong
Measuring CDN performance and why you're doing it wrongMeasuring CDN performance and why you're doing it wrong
Measuring CDN performance and why you're doing it wrong
 
Content Devilery Network
Content Devilery NetworkContent Devilery Network
Content Devilery Network
 
CONTENT DELIVERY NETWORK
CONTENT DELIVERY NETWORK CONTENT DELIVERY NETWORK
CONTENT DELIVERY NETWORK
 
Lec13 cdn
Lec13 cdnLec13 cdn
Lec13 cdn
 
Dynamic Content Acceleration: Lightning Fast Web Apps with Amazon CloudFront ...
Dynamic Content Acceleration: Lightning Fast Web Apps with Amazon CloudFront ...Dynamic Content Acceleration: Lightning Fast Web Apps with Amazon CloudFront ...
Dynamic Content Acceleration: Lightning Fast Web Apps with Amazon CloudFront ...
 
ENSURING FAST AND SECURE GAMING APPLICATION DOWNLOADS GLOBALLY
ENSURING FAST AND SECURE GAMING APPLICATION DOWNLOADS GLOBALLYENSURING FAST AND SECURE GAMING APPLICATION DOWNLOADS GLOBALLY
ENSURING FAST AND SECURE GAMING APPLICATION DOWNLOADS GLOBALLY
 
Caching
CachingCaching
Caching
 
Interative Traffic Engineering in Changing Internet Economics - Tom Daly at L...
Interative Traffic Engineering in Changing Internet Economics - Tom Daly at L...Interative Traffic Engineering in Changing Internet Economics - Tom Daly at L...
Interative Traffic Engineering in Changing Internet Economics - Tom Daly at L...
 
What we can learn from CDNs about Web Development, Deployment, and Performance
What we can learn from CDNs about Web Development, Deployment, and PerformanceWhat we can learn from CDNs about Web Development, Deployment, and Performance
What we can learn from CDNs about Web Development, Deployment, and Performance
 
Optimizing Proxy Server Performance
Optimizing Proxy Server PerformanceOptimizing Proxy Server Performance
Optimizing Proxy Server Performance
 
Implementing Advanced Caching and Replication Techniques in ...
Implementing Advanced Caching and Replication Techniques in ...Implementing Advanced Caching and Replication Techniques in ...
Implementing Advanced Caching and Replication Techniques in ...
 
Web Hosting - What is it?
Web Hosting - What is it?Web Hosting - What is it?
Web Hosting - What is it?
 
Crawl
CrawlCrawl
Crawl
 
The constrained application protocol (coap) part 2
The constrained application protocol (coap)  part 2The constrained application protocol (coap)  part 2
The constrained application protocol (coap) part 2
 
Slides cao
Slides caoSlides cao
Slides cao
 
Covert Timing Channels based on HTTP Cache Headers (Special Edition for Top 1...
Covert Timing Channels based on HTTP Cache Headers (Special Edition for Top 1...Covert Timing Channels based on HTTP Cache Headers (Special Edition for Top 1...
Covert Timing Channels based on HTTP Cache Headers (Special Edition for Top 1...
 
Building your own CDN using Amazon EC2
Building your own CDN using Amazon EC2Building your own CDN using Amazon EC2
Building your own CDN using Amazon EC2
 

Similaire à Challenges behind the scenes of the large Swiss e-Commerce shop apfelkiste.ch and the role of CloudFlare - Sven Härtwig, CTO narf-studios GmbH

Magento performancenbs
Magento performancenbsMagento performancenbs
Magento performancenbs
varien
 

Similaire à Challenges behind the scenes of the large Swiss e-Commerce shop apfelkiste.ch and the role of CloudFlare - Sven Härtwig, CTO narf-studios GmbH (20)

Web Speed And Scalability
Web Speed And ScalabilityWeb Speed And Scalability
Web Speed And Scalability
 
Joomla! Performance on Steroids
Joomla! Performance on SteroidsJoomla! Performance on Steroids
Joomla! Performance on Steroids
 
BrightonSEO 2019 - Edge SEO - Using CDNs To Perform SEO On The Edge
BrightonSEO 2019 - Edge SEO - Using CDNs To Perform SEO On The EdgeBrightonSEO 2019 - Edge SEO - Using CDNs To Perform SEO On The Edge
BrightonSEO 2019 - Edge SEO - Using CDNs To Perform SEO On The Edge
 
Speed Up WordPress Websites - Part 1 - WordPress Cairo Meetup
Speed Up WordPress Websites - Part 1 - WordPress Cairo MeetupSpeed Up WordPress Websites - Part 1 - WordPress Cairo Meetup
Speed Up WordPress Websites - Part 1 - WordPress Cairo Meetup
 
App Deployment on Cloud
App Deployment on CloudApp Deployment on Cloud
App Deployment on Cloud
 
Supercharging Optimizely Performance by Moving Decisions to the Edge
Supercharging Optimizely Performance by Moving Decisions to the EdgeSupercharging Optimizely Performance by Moving Decisions to the Edge
Supercharging Optimizely Performance by Moving Decisions to the Edge
 
Reducing latency on the web with the Azure CDN - DevSum - SWAG
Reducing latency on the web with the Azure CDN - DevSum - SWAGReducing latency on the web with the Azure CDN - DevSum - SWAG
Reducing latency on the web with the Azure CDN - DevSum - SWAG
 
AWS re:Invent 2016: Amazon CloudFront Flash Talks: Best Practices on Configur...
AWS re:Invent 2016: Amazon CloudFront Flash Talks: Best Practices on Configur...AWS re:Invent 2016: Amazon CloudFront Flash Talks: Best Practices on Configur...
AWS re:Invent 2016: Amazon CloudFront Flash Talks: Best Practices on Configur...
 
Website & Internet + Performance testing
Website & Internet + Performance testingWebsite & Internet + Performance testing
Website & Internet + Performance testing
 
CIRCUIT 2015 - Akamai: Caching and Beyond
CIRCUIT 2015 - Akamai:  Caching and BeyondCIRCUIT 2015 - Akamai:  Caching and Beyond
CIRCUIT 2015 - Akamai: Caching and Beyond
 
Scaling to millions of users with Amazon CloudFront - April 2017 AWS Online T...
Scaling to millions of users with Amazon CloudFront - April 2017 AWS Online T...Scaling to millions of users with Amazon CloudFront - April 2017 AWS Online T...
Scaling to millions of users with Amazon CloudFront - April 2017 AWS Online T...
 
Introducing Cloudflare Workers
Introducing Cloudflare WorkersIntroducing Cloudflare Workers
Introducing Cloudflare Workers
 
Magento performancenbs
Magento performancenbsMagento performancenbs
Magento performancenbs
 
I Can Haz More Performanz?
I Can Haz More Performanz?I Can Haz More Performanz?
I Can Haz More Performanz?
 
AWS Summit London 2014 | Dynamic Content Acceleration (300)
AWS Summit London 2014 | Dynamic Content Acceleration (300)AWS Summit London 2014 | Dynamic Content Acceleration (300)
AWS Summit London 2014 | Dynamic Content Acceleration (300)
 
Spreadshirt Techcamp 2018 - Hold until Told
Spreadshirt Techcamp 2018 - Hold until ToldSpreadshirt Techcamp 2018 - Hold until Told
Spreadshirt Techcamp 2018 - Hold until Told
 
Scaling PHP apps
Scaling PHP appsScaling PHP apps
Scaling PHP apps
 
Implementing data and databases on K8s within the Dutch government
Implementing data and databases on K8s within the Dutch governmentImplementing data and databases on K8s within the Dutch government
Implementing data and databases on K8s within the Dutch government
 
Dubbo and Weidian's practice on micro-service architecture
Dubbo and Weidian's practice on micro-service architectureDubbo and Weidian's practice on micro-service architecture
Dubbo and Weidian's practice on micro-service architecture
 
Extending Your Applications to the Edge with CDNs
Extending Your Applications to the Edge with CDNsExtending Your Applications to the Edge with CDNs
Extending Your Applications to the Edge with CDNs
 

Plus de nine

Plus de nine (18)

Delivering real-time video globally at Internet scale - Stefan Birrer, Co-Fou...
Delivering real-time video globally at Internet scale - Stefan Birrer, Co-Fou...Delivering real-time video globally at Internet scale - Stefan Birrer, Co-Fou...
Delivering real-time video globally at Internet scale - Stefan Birrer, Co-Fou...
 
How a titan empowers our cloud monitoring infrastructure
How a titan empowers our cloud monitoring infrastructureHow a titan empowers our cloud monitoring infrastructure
How a titan empowers our cloud monitoring infrastructure
 
GitOps and security by Reto Bollinger, CSIO nine.ch
GitOps and security by Reto Bollinger, CSIO nine.chGitOps and security by Reto Bollinger, CSIO nine.ch
GitOps and security by Reto Bollinger, CSIO nine.ch
 
GCP Meetup #3 - Approaches to Cloud Native Architectures
GCP Meetup #3 - Approaches to Cloud Native ArchitecturesGCP Meetup #3 - Approaches to Cloud Native Architectures
GCP Meetup #3 - Approaches to Cloud Native Architectures
 
Security In The Public Cloud
Security In The Public CloudSecurity In The Public Cloud
Security In The Public Cloud
 
TechTalkThursday: Microservices
TechTalkThursday: MicroservicesTechTalkThursday: Microservices
TechTalkThursday: Microservices
 
Automating OpenShift Deployments
Automating OpenShift DeploymentsAutomating OpenShift Deployments
Automating OpenShift Deployments
 
Docker for Developers
Docker for DevelopersDocker for Developers
Docker for Developers
 
Das Web im Geschwindigkeitsrausch
Das Web im GeschwindigkeitsrauschDas Web im Geschwindigkeitsrausch
Das Web im Geschwindigkeitsrausch
 
TechTalkThursday 29.06.2017: Wie verhält sich DDoS in der Realität?
TechTalkThursday 29.06.2017: Wie verhält sich DDoS in der Realität?TechTalkThursday 29.06.2017: Wie verhält sich DDoS in der Realität?
TechTalkThursday 29.06.2017: Wie verhält sich DDoS in der Realität?
 
TechTalkThursday 02.03.2017: Container-Orchestrierung mit OpenShift - Unser W...
TechTalkThursday 02.03.2017: Container-Orchestrierung mit OpenShift - Unser W...TechTalkThursday 02.03.2017: Container-Orchestrierung mit OpenShift - Unser W...
TechTalkThursday 02.03.2017: Container-Orchestrierung mit OpenShift - Unser W...
 
TechTalkThursday 27.10.2016: Ceph im NVME Cluster
TechTalkThursday 27.10.2016: Ceph im NVME ClusterTechTalkThursday 27.10.2016: Ceph im NVME Cluster
TechTalkThursday 27.10.2016: Ceph im NVME Cluster
 
TechTalkThursday 27.10.2016: Redundante Linux Failover Cluster
TechTalkThursday 27.10.2016: Redundante Linux Failover ClusterTechTalkThursday 27.10.2016: Redundante Linux Failover Cluster
TechTalkThursday 27.10.2016: Redundante Linux Failover Cluster
 
TechTalkThursday 27.10.2016: upd89.org - Orchestrierung von Security-Updates ...
TechTalkThursday 27.10.2016: upd89.org - Orchestrierung von Security-Updates ...TechTalkThursday 27.10.2016: upd89.org - Orchestrierung von Security-Updates ...
TechTalkThursday 27.10.2016: upd89.org - Orchestrierung von Security-Updates ...
 
TechTalkThursday 14.04.2016: Load tests of web applications as a service
TechTalkThursday 14.04.2016: Load tests of web applications as a serviceTechTalkThursday 14.04.2016: Load tests of web applications as a service
TechTalkThursday 14.04.2016: Load tests of web applications as a service
 
TechTalkThursday 14.04.2016: Service Oriented Architecture @nine.ch
TechTalkThursday 14.04.2016: Service Oriented Architecture @nine.chTechTalkThursday 14.04.2016: Service Oriented Architecture @nine.ch
TechTalkThursday 14.04.2016: Service Oriented Architecture @nine.ch
 
TechTalkThursday 26.11.2015: Zentrales Metriken-System - ist der Flügelschlag...
TechTalkThursday 26.11.2015: Zentrales Metriken-System - ist der Flügelschlag...TechTalkThursday 26.11.2015: Zentrales Metriken-System - ist der Flügelschlag...
TechTalkThursday 26.11.2015: Zentrales Metriken-System - ist der Flügelschlag...
 
TechTalkThursday 26.11.2015: Manage the minions - Docker Container mit Kubern...
TechTalkThursday 26.11.2015: Manage the minions - Docker Container mit Kubern...TechTalkThursday 26.11.2015: Manage the minions - Docker Container mit Kubern...
TechTalkThursday 26.11.2015: Manage the minions - Docker Container mit Kubern...
 

Dernier

Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Victor Rentea
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎️+971_581248768%)**%*]'#abortion pills for sale in dubai@
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
panagenda
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
WSO2
 

Dernier (20)

Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
 
Cyberprint. Dark Pink Apt Group [EN].pdf
Cyberprint. Dark Pink Apt Group [EN].pdfCyberprint. Dark Pink Apt Group [EN].pdf
Cyberprint. Dark Pink Apt Group [EN].pdf
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
 

Challenges behind the scenes of the large Swiss e-Commerce shop apfelkiste.ch and the role of CloudFlare - Sven Härtwig, CTO narf-studios GmbH

  • 1. Sven Härtwig – narf-studios GmbH | nine.ch techtalk | 2020-02-25 CLOUDFLARE Why we love it
  • 2. About me Sven Härtwig CEO – narf-studios GmbH About narf-studios Digital agency with a strong technical focus. Based in Hamburg. Specialized in E-Commerce projects with Magento. www.narf-studios.de
  • 3. About apfelkiste.ch One of the TOP 30 Online shops in Switzerland.
 Currently more than 25'000 unique products on stock. 
 Up to over 9 million pageviews a month. Always fast growing in new products and traffic. On Cloudflare for 5 years now.
  • 4. Problems • get out of the line of fire of potential attacks (DDoS / other attacks)
 • Speed. We need more speed!
 • Optimize processes
 • Reduce workload of the webservers
  • 5. In this example all the traffic coming to the subdomain shop is being routed through the cloudflare proxy. The IP of our origin server is now hidden from the internet by cloudflare. Do this with a new IP address!
 
 An attacker does not know the IP address of the actual origin server and puts all his effort to ... 
 the protection of Cloudflare. In the line of fire! DNS Obfuscation
  • 6. Cloudflare protects the infrastructure from a DDoS attack with a global capacity of 59 Tbps (7,375 TB/s). 
 Should be enough. Cloudflare can manage most of the incoming common threats. (DDoS, known exploits, Rate limiting)
 
 Nothing is secure by 100%! Things like XSS are still vulnerable!
 You have to secure your application (anyway)
 
 ... by firewall rules
 ... by always remembering the existence of murphy's law when developing your application
 ... by avoiding doing stupid things In the line of fire! Protection (DDoS / WAF)
  • 7. In the line of fire! Firewall Cloudflare offers rulesets (managed rules) for different web applications which can 
 be turned on with one click and keeps you safe for a lot of known attacks related to your software
  • 8. Speed! At first there is the slowness Old setup – before we knew nine ;) • (poor configured) Varnish as caching layer • no CDN at all. Followed by a CDN provider which latency was worse than without a CDN. • no optimized processes.
  • 9. Speed! What does slow mean to an ecommerce business?
  • 10. Why speed matters! • Users hate a slow website. If it is too slow ... they are gone. 
 This means: YOU are losing money! • Search Engines are creating a score of your website. 
 The speed is an important criterion for your ranking.
 This means: less traffic / higher costs to get traffic and this means: YOU are losing money! • Each improvement in speed performance matters and enables your users to access your website more quickly or even at all (think of mobile users sitting in a train).
 This means: YOU are earning more money! Speed!
  • 11. With Cloudflare in front Speed! Together with nine we put cloudflare in front of our setup. Result: • a fully working full page cache (FPC) with a CDN for all assets which can be handled really easy • no VCL configuration needed. Only pagerules are needed which can be set up on the CF dashboard very easy.
  • 12. With Cloudflare in front Speed!
  • 13. Speed! How cloudflare helped us so far • Very low latency for dns lookups and response times for content (if located in the edge cache) • The edge cache of Cloudflare.
  • 14. Speed! Some speed optimization tools CF offers • Auto minify
 HTML / CSS / JS can be minified by CF. • Polish
 Reduces the image size by removing metadata and applies compression (lossless, lossy, webp) if configured to. • Brotli (compression) • HTTP2 Priorization / TCP Turbo / Rocket Loader / Railgun / prefetch • Mirage (beta) • AMP Real URL
  • 15. Speed! Pagerules + the edge cache • Every asset / route (GET Requests) can be stored in the edge cache configured by a pagerule. • It is easy to purge the caches either on the dashboard or by using the API. 
 Possible ways:
 
 URL = https://www.narf.it/product.html || https://www.narf.it (for purging only the homepage)
 
 Hostname = www.narf.it 
 
 tag = products
 
 prefix = css (purge all cache objects contained by the folder or url segment "css". narf.it/css/* recursively)
 
 Or just purge all!
  • 16. Speed! A simple pagerule This simple rule would cache all .html docs for all subdomains of narf.it for 7 days in the CF edge cache.
  • 17. Speed! What you can do with pagerules CF offers you a lot of possibilities you can combine. Most used use cases for pagerules are: • cache rules • do not cache rules which override previously defined caching rules • more specific caching rules for assets
 (for example: higher edge / browser cache ttl for image files which never change => also improves the performance) • 30x forwardings based on routes
  • 18. Speed! Problems with purging the caches. Purging cache objects by URL is okay... but not if you have to purge thousands of unique URLs. Each purge API request is limited to 30 entries. 
 This may lead to a very time consuming process which can take ages. Purging all CF cache nodes may take up to 30 seconds.
  • 19. Speed! A better purging process Purging by URL ladekabel/kabel.html
 apple/kabel.html
 zubehor/kabel.html Purging by tag ladekabel/kabel.html
 apple/kabel.html
 zubehor/kabel.html Hey CF. Please purge:
 
 url: ladekabel/kabel.html,
 url: apple/kabel.html,
 url: zubehor/kabel.html Hey CF. Please purge:
 
 tag: kabel add cache tag to all URLs: kabel } done by the application with a response header
  • 20. Workers What is it good for? Cloudflare Workers provide a serverless execution environment based on javascript. Some things a worker can do: • change requests and responses • fetch / send data from / to other origins or our webserver in the background • store and use limited data as environment variable • replace html without purging caches
  • 23. Workers The FPC, I have to change data situation
  • 24. Workers The FPC + AJAX situation
  • 26. Workers But wait ... we want more speed!