SlideShare a Scribd company logo
1 of 62
Varnish e caching di
 applicazioni Rails

        RubyDay 2011
      Antonio Carpentieri
Disclaimer
l’applicazione
All’inizio andava tutto
          bene
Poi è arrivato il momento
    di mettere online
       store.inter.it
Che si fa?
Reverse Proxy
“Varnish is a reverse Web accelerator designed for content-heavy
dynamic web sites. In contrast to other HTTP accelerators, many
of which began life as client-side proxies or origin servers,
Varnish was designed from the ground up as an accelerator for
incoming traffic.”
Quali vantaggi otteniamo?
Come si configura?
Come si configura?

• NON con un file in cui abiliti e disabiliti opzioni
Come si configura?

• NON con un file in cui abiliti e disabiliti opzioni
• Varnish Configuration Language (VCL)
Come si configura?

• NON con un file in cui abiliti e disabiliti opzioni
• Varnish Configuration Language (VCL)
• il VCL un DSL che viene compilato in codice C
Come si configura?

• NON con un file in cui abiliti e disabiliti opzioni
• Varnish Configuration Language (VCL)
• il VCL un DSL che viene compilato in codice C
• Espone gli hookpoint per gestire il cliclo di vita della
   richiesta
Come si configura?

• NON con un file in cui abiliti e disabiliti opzioni
• Varnish Configuration Language (VCL)
• il VCL un DSL che viene compilato in codice C
• Espone gli hookpoint per gestire il cliclo di vita della
   richiesta

• Può essere caricato senza fermare il servizio
Come si configura?

• NON con un file in cui abiliti e disabiliti opzioni
• Varnish Configuration Language (VCL)
• il VCL un DSL che viene compilato in codice C
• Espone gli hookpoint per gestire il cliclo di vita della
   richiesta

• Può essere caricato senza fermare il servizio
• Si può switchare a caldo da una configurazione ad un’altra
Gli hook points

    • vcl_recv         Arriva la richiesta, qui decidi cosa farne

    • vcl_fetch      E’ stata recuparata la risorsa dal backend,
      la puoi modificare prima di mandarla al client

    • vcl_hash       Calcola l’hash key per la ricerca, di default
      è solo l’URL completa



Gli altri hooks:
vcl_deliver, vcl_miss, vcl_hit, vcl_error, vcl_discard, vcl_timeout,
vcl_pipe, vcl_pass
Varnish non “casha” niente che
 sia “privato” o che abbia un
           cookie...
e Rails ci mette del suo
 per non farsi cachare
Cookie di sessione
Middleware




http://www.coffeepowered.net/2011/01/29/rails-varnish-cookie-sessions-and-csrf-tokens/
Middleware
cache-control private
helper method
helper method in
     action
Risultato
Vogliamo parlare dei
 tracking cookies?
Filtriamoli
Invalidare la cache
PURGE
PURGE

varnishadm -T 1.2.3.4:6082 purge.url ‘url_da_invalidare’
PURGE

varnishadm -T 1.2.3.4:6082 purge.url ‘url_da_invalidare’
Usando gli sweepers
  # Gemfile
  gem 'schoefmax-klarlack', :require => ‘klarlack’
  # environment.rb
  VARNISH = Varnish::Client.new(‘1.2.3.4:6082’)

class ProductSweeper < ActionController::Caching::Sweeper
  observe Product # This sweeper is going to keep an eye on the Product model
  include ActionController::UrlWriter
 
  # If our sweeper detects that a Product was created call this
  def after_create(product)
          expire_cache_for(product)
  end
 
  # If our sweeper detects that a Product was updated call this
  def after_update(product)
          expire_cache_for(product)
  end
 
  # If our sweeper detects that a Product was deleted call this
  def after_destroy(product)
          expire_cache_for(product)
  end
 
  private
  def expire_cache_for(product)
    VARNISH.purge :url, product_path(product)
  end
end
The “Vary” Pitfalls
User agents
User-Agent: TwengaBot-2.0 (http://www.twenga.com/bot.html)
User-Agent: Mozilla/5.0 (compatible; Yahoo! Slurp; http://help.yahoo.com/help/us/ysearch/slurp)
User-Agent: Mozilla/5.0 (Windows NT 6.1; rv:2.0.1) Gecko/20100101 Firefox/4.0.1
User-Agent: Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)
User-Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; .NET CLR 2.0.50727; .NE
User-Agent: Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; Trident/5.0)
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_6_7) AppleWebKit/534.24 (KHTML, like Gecko) C
User-Agent: Mozilla/5.0 (Windows NT 6.0) AppleWebKit/534.30 (KHTML, like Gecko) Chrome/12.0.742.91
User-Agent: Mozilla/5.0 (Windows NT 6.0; rv:2.0.1) Gecko/20100101 Firefox/4.0.1
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.9.1.8) Gecko/20100202 Firefox/3.5.
User-Agent: Mozilla/5.0 (compatible; bingbot/2.0; +http://www.bing.com/bingbot.htm)
User-Agent: Mozilla/5.0 (Windows NT 5.1) AppleWebKit/534.24 (KHTML, like Gecko) Chrome/11.0.696.77
User-Agent: Opera/9.80 (Windows NT 6.1; U; ja) Presto/2.8.131 Version/11.11
User-Agent: Googlebot-Image/1.0
User-Agent: Mozilla/5.0 (Macintosh; U; PPC Mac OS X 10_5_8; it-it) AppleWebKit/533.21.1 (KHTML, lik
User-Agent:YottaaMonitor
User-Agent: Mozilla/5.0 (compatible; FatBot 2.0; http://www.thefind.com/crawler)
User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_6_7; en-us) AppleWebKit/533.21.1 (KHTML, l
User-Agent: Mozilla/5.0 (Windows NT 5.1) AppleWebKit/534.30 (KHTML, like Gecko) Chrome/12.0.742.91
User-Agent: Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; WOW64; Trident/5.0)
User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_6_7; ar) AppleWebKit/533.21.1 (KHTML, like
User-Agent: Mozilla/5.0 (compatible; YandexBot/3.0; +http://yandex.com/bots)
User-Agent: Mozilla/5.0 (Windows NT 6.1) AppleWebKit/534.30 (KHTML, like Gecko) Chrome/12.0.742.91
User-Agent: Mozilla/5.0 (Macintosh; U; PPC Mac OS X 10.4; en-US; rv:1.9.2.17) Gecko/20110420 Firefo
User-Agent: Mozilla/5.0 (iPad; U; CPU OS 4_3_3 like Mac OS X; it-it) AppleWebKit/533.17.9 (KHTML, l
User-Agent: ELB-HealthChecker/1.0
Accept-languages
Accept-languages

Accept-Language: it
Accept-languages

Accept-Language: it
Accept-Language: it-IT
Accept-languages

Accept-Language: it
Accept-Language: it-IT
Accept-Language: it-it,it;q=0.8,en-us;q=0.5
Accept-languages

Accept-Language:   it
Accept-Language:   it-IT
Accept-Language:   it-it,it;q=0.8,en-us;q=0.5
Accept-Language:   it, en-us;q=0.8, en;q=0.7
Accept-languages

Accept-Language:   it
Accept-Language:   it-IT
Accept-Language:   it-it,it;q=0.8,en-us;q=0.5
Accept-Language:   it, en-us;q=0.8, en;q=0.7
Accept-Language:   it, en-us;q=0.8, en;q=0.3
Accept-languages




https://github.com/cosimo/varnish-accept-language/
Accept-encoding
Accept-encoding


Accept-Encoding:gzip
Accept-encoding


Accept-Encoding:gzip
Accept-Encoding:gzip,deflate
Accept-encoding


Accept-Encoding:gzip
Accept-Encoding:gzip,deflate

Accept-Encoding:deflate,gzip
Accept-encoding


Accept-Encoding:gzip
Accept-Encoding:gzip,deflate

Accept-Encoding:deflate,gzip
Accept-Encoding:deflate, gzip
Accept-encoding


Accept-Encoding:gzip
Accept-Encoding:gzip,deflate

Accept-Encoding:deflate,gzip
Accept-Encoding:deflate, gzip

Accept-Encoding:gzip,deflate,sdch
Accept-encoding
Quali tools offre?
Quali tools offre?

•varnishtop
Quali tools offre?

•varnishtop
 • varnishtop -i RxHeader -I ^User-Agent
Quali tools offre?

•varnishtop
 • varnishtop -i RxHeader -I ^User-Agent
 • varnishtop -i RxUrl
Quali tools offre?

•varnishtop
 • varnishtop -i RxHeader -I ^User-Agent
 • varnishtop -i RxUrl
 • varnishtop -i RxHeader -I ^Referer
Quali tools offre?

•varnishtop
 • varnishtop -i RxHeader -I ^User-Agent
 • varnishtop -i RxUrl
 • varnishtop -i RxHeader -I ^Referer
•varnishadm
Quali tools offre?

•varnishtop
 • varnishtop -i RxHeader -I ^User-Agent
 • varnishtop -i RxUrl
 • varnishtop -i RxHeader -I ^Referer
•varnishadm
 • vcl.load newconf /etc/conf2011.vcl
Quali tools offre?

•varnishtop
 • varnishtop -i RxHeader -I ^User-Agent
 • varnishtop -i RxUrl
 • varnishtop -i RxHeader -I ^Referer
•varnishadm
 • vcl.load newconf /etc/conf2011.vcl
 • purge.url “^/stylesheets/”
Quali tools offre?

•varnishtop
 • varnishtop -i RxHeader -I ^User-Agent
 • varnishtop -i RxUrl
 • varnishtop -i RxHeader -I ^Referer
•varnishadm
 • vcl.load newconf /etc/conf2011.vcl
 • purge.url “^/stylesheets/”
•varnishstat
Quali tools offre?

•varnishtop
 • varnishtop -i RxHeader -I ^User-Agent
 • varnishtop -i RxUrl
 • varnishtop -i RxHeader -I ^Referer
•varnishadm
 • vcl.load newconf /etc/conf2011.vcl
 • purge.url “^/stylesheets/”
•varnishstat
•varnishhist
Dove siamo arrivati?
VARNISH 3.0




Key Features
 • Compression support including ESI
 • Plugin support in Varnish with VMODs
 • Much improved tools and performance
Other Features
 •   Enhanced ESI support including stiching together compressed ESI fragments.
 •   Saint and Grace mode.
 •   DNS, Random, Hashing and Client IP based Directors.
 •   A much improved VCL.
 •   Preliminary support for Streaming support, both on miss and on pass.
Grazie per l’attenzione!


   antonio.carpentieri@xpeppers.com

   @acarpe


   http://acarpe.wordpress.com

More Related Content

What's hot

DEF CON 24 - workshop - Craig Young - brainwashing embedded systems
DEF CON 24 - workshop - Craig Young - brainwashing embedded systemsDEF CON 24 - workshop - Craig Young - brainwashing embedded systems
DEF CON 24 - workshop - Craig Young - brainwashing embedded systemsFelipe Prado
 
Hack & Fix, Hands on ColdFusion Security Training
Hack & Fix, Hands on ColdFusion Security TrainingHack & Fix, Hands on ColdFusion Security Training
Hack & Fix, Hands on ColdFusion Security TrainingColdFusionConference
 
How to CASifying PeopleSoft and Integrating CAS and ADFS
How to CASifying PeopleSoft and Integrating CAS and ADFSHow to CASifying PeopleSoft and Integrating CAS and ADFS
How to CASifying PeopleSoft and Integrating CAS and ADFSJohn Gasper
 
Introduction to vSphere APIs Using pyVmomi
Introduction to vSphere APIs Using pyVmomiIntroduction to vSphere APIs Using pyVmomi
Introduction to vSphere APIs Using pyVmomiMichael Rice
 
Keybase Vault Auto-Unseal HashiTalks2020
Keybase Vault Auto-Unseal HashiTalks2020Keybase Vault Auto-Unseal HashiTalks2020
Keybase Vault Auto-Unseal HashiTalks2020Bas Meijer
 
Comment améliorer le quotidien des Développeurs PHP ?
Comment améliorer le quotidien des Développeurs PHP ?Comment améliorer le quotidien des Développeurs PHP ?
Comment améliorer le quotidien des Développeurs PHP ?AFUP_Limoges
 
Advanced nginx in mercari - How to handle over 1,200,000 HTTPS Reqs/Min
Advanced nginx in mercari - How to handle over 1,200,000 HTTPS Reqs/MinAdvanced nginx in mercari - How to handle over 1,200,000 HTTPS Reqs/Min
Advanced nginx in mercari - How to handle over 1,200,000 HTTPS Reqs/MinMasahiro Nagano
 
My Database Skills Killed the Server
My Database Skills Killed the ServerMy Database Skills Killed the Server
My Database Skills Killed the ServerColdFusionConference
 
Deployment with Ruby on Rails
Deployment with Ruby on RailsDeployment with Ruby on Rails
Deployment with Ruby on RailsJonathan Weiss
 
Paris FOD meetup - kafka security 101
Paris FOD meetup - kafka security 101Paris FOD meetup - kafka security 101
Paris FOD meetup - kafka security 101Abdelkrim Hadjidj
 
Automating Compliance with InSpec - Chef Singapore Meetup
Automating Compliance with InSpec - Chef Singapore MeetupAutomating Compliance with InSpec - Chef Singapore Meetup
Automating Compliance with InSpec - Chef Singapore MeetupMatt Ray
 

What's hot (17)

Securing Legacy CFML Code
Securing Legacy CFML CodeSecuring Legacy CFML Code
Securing Legacy CFML Code
 
Realtime with websockets
Realtime with websocketsRealtime with websockets
Realtime with websockets
 
Cfml features modern_coding
Cfml features modern_codingCfml features modern_coding
Cfml features modern_coding
 
DEF CON 24 - workshop - Craig Young - brainwashing embedded systems
DEF CON 24 - workshop - Craig Young - brainwashing embedded systemsDEF CON 24 - workshop - Craig Young - brainwashing embedded systems
DEF CON 24 - workshop - Craig Young - brainwashing embedded systems
 
Hack & Fix, Hands on ColdFusion Security Training
Hack & Fix, Hands on ColdFusion Security TrainingHack & Fix, Hands on ColdFusion Security Training
Hack & Fix, Hands on ColdFusion Security Training
 
Realtime with-websockets-2015
Realtime with-websockets-2015Realtime with-websockets-2015
Realtime with-websockets-2015
 
How to CASifying PeopleSoft and Integrating CAS and ADFS
How to CASifying PeopleSoft and Integrating CAS and ADFSHow to CASifying PeopleSoft and Integrating CAS and ADFS
How to CASifying PeopleSoft and Integrating CAS and ADFS
 
Root via XSS
Root via XSSRoot via XSS
Root via XSS
 
Introduction to vSphere APIs Using pyVmomi
Introduction to vSphere APIs Using pyVmomiIntroduction to vSphere APIs Using pyVmomi
Introduction to vSphere APIs Using pyVmomi
 
Keybase Vault Auto-Unseal HashiTalks2020
Keybase Vault Auto-Unseal HashiTalks2020Keybase Vault Auto-Unseal HashiTalks2020
Keybase Vault Auto-Unseal HashiTalks2020
 
Comment améliorer le quotidien des Développeurs PHP ?
Comment améliorer le quotidien des Développeurs PHP ?Comment améliorer le quotidien des Développeurs PHP ?
Comment améliorer le quotidien des Développeurs PHP ?
 
Advanced nginx in mercari - How to handle over 1,200,000 HTTPS Reqs/Min
Advanced nginx in mercari - How to handle over 1,200,000 HTTPS Reqs/MinAdvanced nginx in mercari - How to handle over 1,200,000 HTTPS Reqs/Min
Advanced nginx in mercari - How to handle over 1,200,000 HTTPS Reqs/Min
 
Locking Down CF Servers
Locking Down CF ServersLocking Down CF Servers
Locking Down CF Servers
 
My Database Skills Killed the Server
My Database Skills Killed the ServerMy Database Skills Killed the Server
My Database Skills Killed the Server
 
Deployment with Ruby on Rails
Deployment with Ruby on RailsDeployment with Ruby on Rails
Deployment with Ruby on Rails
 
Paris FOD meetup - kafka security 101
Paris FOD meetup - kafka security 101Paris FOD meetup - kafka security 101
Paris FOD meetup - kafka security 101
 
Automating Compliance with InSpec - Chef Singapore Meetup
Automating Compliance with InSpec - Chef Singapore MeetupAutomating Compliance with InSpec - Chef Singapore Meetup
Automating Compliance with InSpec - Chef Singapore Meetup
 

Similar to Varnish e caching di applicazioni Rails

Caching with Varnish
Caching with VarnishCaching with Varnish
Caching with Varnishschoefmax
 
Docker presentasjon java bin
Docker presentasjon java binDocker presentasjon java bin
Docker presentasjon java binOlve Hansen
 
Linux containers and docker
Linux containers and dockerLinux containers and docker
Linux containers and dockerFabio Fumarola
 
9th docker meetup 2016.07.13
9th docker meetup 2016.07.139th docker meetup 2016.07.13
9th docker meetup 2016.07.13Amrita Prasad
 
The Hacking Games - A Road to Post Exploitation Meetup - 20240222.pptx
The Hacking Games - A Road to Post Exploitation Meetup - 20240222.pptxThe Hacking Games - A Road to Post Exploitation Meetup - 20240222.pptx
The Hacking Games - A Road to Post Exploitation Meetup - 20240222.pptxlior mazor
 
Habitat talk at CodeMonsters Sofia, Bulgaria Nov 27 2018
Habitat talk at CodeMonsters Sofia, Bulgaria Nov 27 2018Habitat talk at CodeMonsters Sofia, Bulgaria Nov 27 2018
Habitat talk at CodeMonsters Sofia, Bulgaria Nov 27 2018Mandi Walls
 
WebRTC Live Q&A Session #5 - JavaScript Promises and WebRTC Interoperability ...
WebRTC Live Q&A Session #5 - JavaScript Promises and WebRTC Interoperability ...WebRTC Live Q&A Session #5 - JavaScript Promises and WebRTC Interoperability ...
WebRTC Live Q&A Session #5 - JavaScript Promises and WebRTC Interoperability ...Amir Zmora
 
My Opera meets Varnish, Dec 2009
My Opera meets Varnish, Dec 2009My Opera meets Varnish, Dec 2009
My Opera meets Varnish, Dec 2009Cosimo Streppone
 
It's Time to Debloat the Cloud with Unikraft
It's Time to Debloat the Cloud with UnikraftIt's Time to Debloat the Cloud with Unikraft
It's Time to Debloat the Cloud with UnikraftScyllaDB
 
Killer Docker Workflows for Development
Killer Docker Workflows for DevelopmentKiller Docker Workflows for Development
Killer Docker Workflows for DevelopmentChris Tankersley
 
Detailed Introduction To Docker
Detailed Introduction To DockerDetailed Introduction To Docker
Detailed Introduction To Dockernklmish
 
Automated Infrastructure and Application Management
Automated Infrastructure and Application ManagementAutomated Infrastructure and Application Management
Automated Infrastructure and Application ManagementClark Everetts
 
Building Mobile Friendly APIs in Rails
Building Mobile Friendly APIs in RailsBuilding Mobile Friendly APIs in Rails
Building Mobile Friendly APIs in RailsJim Jeffers
 
Apache Street Smarts Presentation (SANS 99)
Apache Street Smarts Presentation (SANS 99)Apache Street Smarts Presentation (SANS 99)
Apache Street Smarts Presentation (SANS 99)Michael Dobe, Ph.D.
 
Detecting Events on the Web in Real Time with Java, Kafka and ZooKeeper - Jam...
Detecting Events on the Web in Real Time with Java, Kafka and ZooKeeper - Jam...Detecting Events on the Web in Real Time with Java, Kafka and ZooKeeper - Jam...
Detecting Events on the Web in Real Time with Java, Kafka and ZooKeeper - Jam...JAXLondon2014
 
Version Control and Continuous Integration
Version Control and Continuous IntegrationVersion Control and Continuous Integration
Version Control and Continuous IntegrationGeff Henderson Chang
 
AV Evasion with the Veil Framework
AV Evasion with the Veil FrameworkAV Evasion with the Veil Framework
AV Evasion with the Veil FrameworkVeilFramework
 
Windows 與 Azure 的容器旅程 @ Skilltree Day
Windows 與 Azure 的容器旅程 @ Skilltree DayWindows 與 Azure 的容器旅程 @ Skilltree Day
Windows 與 Azure 的容器旅程 @ Skilltree DayJeff Chu
 

Similar to Varnish e caching di applicazioni Rails (20)

Caching with Varnish
Caching with VarnishCaching with Varnish
Caching with Varnish
 
Docker presentasjon java bin
Docker presentasjon java binDocker presentasjon java bin
Docker presentasjon java bin
 
Linux containers and docker
Linux containers and dockerLinux containers and docker
Linux containers and docker
 
9th docker meetup 2016.07.13
9th docker meetup 2016.07.139th docker meetup 2016.07.13
9th docker meetup 2016.07.13
 
The Hacking Games - A Road to Post Exploitation Meetup - 20240222.pptx
The Hacking Games - A Road to Post Exploitation Meetup - 20240222.pptxThe Hacking Games - A Road to Post Exploitation Meetup - 20240222.pptx
The Hacking Games - A Road to Post Exploitation Meetup - 20240222.pptx
 
Habitat talk at CodeMonsters Sofia, Bulgaria Nov 27 2018
Habitat talk at CodeMonsters Sofia, Bulgaria Nov 27 2018Habitat talk at CodeMonsters Sofia, Bulgaria Nov 27 2018
Habitat talk at CodeMonsters Sofia, Bulgaria Nov 27 2018
 
WebRTC Live Q&A Session #5 - JavaScript Promises and WebRTC Interoperability ...
WebRTC Live Q&A Session #5 - JavaScript Promises and WebRTC Interoperability ...WebRTC Live Q&A Session #5 - JavaScript Promises and WebRTC Interoperability ...
WebRTC Live Q&A Session #5 - JavaScript Promises and WebRTC Interoperability ...
 
My Opera meets Varnish, Dec 2009
My Opera meets Varnish, Dec 2009My Opera meets Varnish, Dec 2009
My Opera meets Varnish, Dec 2009
 
It's Time to Debloat the Cloud with Unikraft
It's Time to Debloat the Cloud with UnikraftIt's Time to Debloat the Cloud with Unikraft
It's Time to Debloat the Cloud with Unikraft
 
Killer Docker Workflows for Development
Killer Docker Workflows for DevelopmentKiller Docker Workflows for Development
Killer Docker Workflows for Development
 
Detailed Introduction To Docker
Detailed Introduction To DockerDetailed Introduction To Docker
Detailed Introduction To Docker
 
Online spanish meetup #2
Online spanish meetup #2Online spanish meetup #2
Online spanish meetup #2
 
Varnish Cache
Varnish CacheVarnish Cache
Varnish Cache
 
Automated Infrastructure and Application Management
Automated Infrastructure and Application ManagementAutomated Infrastructure and Application Management
Automated Infrastructure and Application Management
 
Building Mobile Friendly APIs in Rails
Building Mobile Friendly APIs in RailsBuilding Mobile Friendly APIs in Rails
Building Mobile Friendly APIs in Rails
 
Apache Street Smarts Presentation (SANS 99)
Apache Street Smarts Presentation (SANS 99)Apache Street Smarts Presentation (SANS 99)
Apache Street Smarts Presentation (SANS 99)
 
Detecting Events on the Web in Real Time with Java, Kafka and ZooKeeper - Jam...
Detecting Events on the Web in Real Time with Java, Kafka and ZooKeeper - Jam...Detecting Events on the Web in Real Time with Java, Kafka and ZooKeeper - Jam...
Detecting Events on the Web in Real Time with Java, Kafka and ZooKeeper - Jam...
 
Version Control and Continuous Integration
Version Control and Continuous IntegrationVersion Control and Continuous Integration
Version Control and Continuous Integration
 
AV Evasion with the Veil Framework
AV Evasion with the Veil FrameworkAV Evasion with the Veil Framework
AV Evasion with the Veil Framework
 
Windows 與 Azure 的容器旅程 @ Skilltree Day
Windows 與 Azure 的容器旅程 @ Skilltree DayWindows 與 Azure 的容器旅程 @ Skilltree Day
Windows 與 Azure 的容器旅程 @ Skilltree Day
 

Recently uploaded

DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningLars Bell
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Mark Simos
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxNavinnSomaal
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Mattias Andersson
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity PlanDatabarracks
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024Stephanie Beckett
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupFlorian Wilhelm
 
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfHyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfPrecisely
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .Alan Dix
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxLoriGlavin3
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr BaganFwdays
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii SoldatenkoFwdays
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsRizwan Syed
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfAddepto
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxLoriGlavin3
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxLoriGlavin3
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxLoriGlavin3
 

Recently uploaded (20)

DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine Tuning
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptx
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity Plan
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project Setup
 
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfHyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko
 
DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special EditionDMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL Certs
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdf
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptx
 

Varnish e caching di applicazioni Rails

Editor's Notes

  1. \n
  2. Vi avverto faccio delle battute che non fanno ridere... a volte non rido nemmeno io dopo averle fatte\n
  3. \n
  4. Porting incrementale\ncon una macchina XL 8 core teniamo tutti gli store\n
  5. 400k\ntutto rallenta drasticamente 3 macchine xl non bastano e tempi di risposta anche di 8secondi!\n
  6. analizzato il traffico\nmaggior parte visitatori senza carrello\nprima cache poi ottimizzazione codice\n
  7. \n
  8. Mentre un forward proxy &amp;#xE8; situato di solito tra il client ed il server che ha la risorsa richiesta, un reverse proxy &amp;#xE8; solitamente situato pi&amp;#xF9; vicino al server e ritorner&amp;#xE0; solo un insieme preconfigurato di risorse\n
  9. possiamo bilanciare il carico tra il nostro cluster di server\npossiamo avere una cache centralizzata\npossiamo utilizzare della logica avanzata per determinare come e quando cachare o servire dalla cache\nmeglio di squid perch&amp;#xE8; delega al sistema operativo la gestione della memoria\n
  10. \n
  11. \n
  12. \n
  13. \n
  14. \n
  15. \n
  16. \n
  17. \n
  18. A rails non piace il caching\nBasta guardare agli headers http\n
  19. \n
  20. \n
  21. Per i cookie si risolve aggiungendo al middleware una classe che rimuove il cookie se non contiene altre info\n
  22. \n
  23. da aggiungere sulle action che si vuole cachare\n
  24. \n
  25. \n
  26. \n
  27. \n
  28. \n
  29. \n
  30. \n
  31. \n
  32. per ogni pagina ci possono essere anche centinaia di versioni\n
  33. come si fa a normalizzarli?\n
  34. ottimo vcl per la normalizzazione dei linguaggi \n
  35. ottimo vcl per la normalizzazione dei linguaggi \n
  36. ottimo vcl per la normalizzazione dei linguaggi \n
  37. ottimo vcl per la normalizzazione dei linguaggi \n
  38. ottimo vcl per la normalizzazione dei linguaggi \n
  39. \n
  40. \n
  41. \n
  42. \n
  43. \n
  44. \n
  45. \n
  46. \n
  47. \n
  48. \n
  49. \n
  50. \n
  51. \n
  52. \n
  53. \n
  54. \n
  55. \n
  56. \n
  57. \n