SlideShare una empresa de Scribd logo
1 de 78
Caching
HTTP’s Best Kept Secret
Ryan Tomayko
  http://tomayko.com/
Sinatra
http://www.sinatrarb.com
Rack
http://rack.rubyforge.org
Rack::Cache
http://tomayko.com/src/rack-cache
Heroku
http://heroku.com
HTTP Caching?
NOT Rails Caching
GET /foo HTTP/1.1
Host: www.foo.com
User-Agent: FooBrowser/1.0
Cache-Control: max-age=0
If-Modified-Since: Mon, 01 Jan 1979 ...
If-None-Match: abcdef0123456789
Accept: *



                   HTTP/1.1 200 OK
                   Content-Type: text/html
                   Content-Length: 24
                   Cache-Control: max-age=300
                   Last-Modified: Mon, 02 Jan 1979 ...
                   ETag: abcdef0123456789
                   Vary: Accept
GET /foo HTTP/1.1
Host: www.foo.com
User-Agent: FooBrowser/1.0
Cache-Control: max-age=0
If-Modified-Since: Mon, 01 Jan 1979 ...
If-None-Match: abcdef0123456789
Accept: *



                   HTTP/1.1 200 OK
                   Content-Type: text/html
                   Content-Length: 24
                   Cache-Control: public, max-age=300
                   Last-Modified: Mon, 02 Jan 1979 ...
                   ETag: abcdef0123456789
                   Vary: Accept
Types of Caches
Client Cache

Client    Client   Client
Cache     Cache    Cache




         foo.com
Shared Proxy Cache



      Shared Proxy
         Cache



       foo.com
Shared Proxy Cache

  Cache             Cache




          foo.com
Shared Proxy Cache
Gateway Cache



    foo.com
     Gateway
      Cache

     Backend
Caches Everywhere

 Client             Client
 Cache              Cache
           Shared
           Cache




          foo.com
          Gateway
           Cache

          Backend
Why Cache?
November 1990
November 1990


Web Population: 1
February 1996


Web Population: 20M
February 1996


Modem Speed: 28.8kbps
February 1996
February 1996
Bandwidth.
February 1996


RFC 1945 - HTTP/1.0
March 1999


RFC 2616 - HTTP/1.1
Today
Expiration
Gateway Cache
Alice                   Backend
Gateway Cache
Alice                                   Backend




        GET /foo
        Host: foo.com
Gateway Cache
Alice                                             Backend




        GET /foo                  GET /foo
        Host: foo.com             Host: foo.com
Gateway Cache
Alice                                                                     Backend




        GET /foo                  GET /foo
        Host: foo.com             Host: foo.com




                                        200OK
                                        Cache-Control:public,max-age=60
Gateway Cache
Alice                                                                                      Backend




        GET /foo                                   GET /foo
        Host: foo.com                              Host: foo.com




                                                         200OK
            200OK
                                                         Cache-Control:public,max-age=60
            Cache-Control:public,max-age=60
Gateway Cache
Bob   (30 seconds later)                   Backend
Gateway Cache
Bob   (30 seconds later)                   Backend




      GET /foo
      Host: foo.com
Gateway Cache
Bob   (30 seconds later)                                Backend




      GET /foo
      Host: foo.com




           200OK
           Cache-Control:public,max-age=60
           Age:30
Gateway Cache
Carol   (60 seconds later)                   Backend
Gateway Cache
Carol   (60 seconds later)                   Backend




        GET /foo
        Host: foo.com
Gateway Cache
Carol   (60 seconds later)                             Backend




        GET /foo                       GET /foo
        Host: foo.com                  Host: foo.com
Gateway Cache
Carol   (60 seconds later)                                                     Backend




        GET /foo                       GET /foo
        Host: foo.com                  Host: foo.com




                                             200OK
                                             Cache-Control:public,max-age=60
Gateway Cache
Carol   (60 seconds later)                                                                  Backend




        GET /foo                                    GET /foo
        Host: foo.com                               Host: foo.com




                                                          200OK
             200OK
                                                          Cache-Control:public,max-age=60
             Cache-Control:public,max-age=60
expires_in
class FooController < Application

 def show
  expires_in 60.seconds, :public => true
  @foo = Foo.find(params[:id])
  render :action => 'show'
 end

end
Sinatra
get '/foo' do
 headers['Cache-Control'] =
              'public, max-age=60'
 @foo = Foo.find_and_stu
 erb :foo
end
Validation
 (Conditional GET)
Gateway Cache
Alice                   Backend
Gateway Cache
Alice                                   Backend




        GET /foo
        Host: foo.com
Gateway Cache
Alice                                             Backend




        GET /foo                  GET /foo
        Host: foo.com             Host: foo.com
Gateway Cache
Alice                                                         Backend




        GET /foo                  GET /foo
        Host: foo.com             Host: foo.com




                                        200OK
                                        ETag:quot;abcdef012345quot;
Gateway Cache
Alice                                                                   Backend




        GET /foo                            GET /foo
        Host: foo.com                       Host: foo.com




                                                  200OK
            200OK
                                                  ETag:quot;abcdef012345quot;
            ETag:quot;abcdef012345quot;
Gateway Cache
Bob                   Backend
Gateway Cache
Bob                                   Backend




      GET /foo
      Host: foo.com
Gateway Cache
Bob                                                           Backend




                                GET /foo
      GET /foo                  Host: foo.com
      Host: foo.com             If-None-Match: abcdef012345
Gateway Cache
Bob                                                           Backend




                                GET /foo
      GET /foo                  Host: foo.com
      Host: foo.com             If-None-Match: abcdef012345




                                      304NotModified
Gateway Cache
Bob                                                                   Backend




                                        GET /foo
      GET /foo                          Host: foo.com
      Host: foo.com                     If-None-Match: abcdef012345




                                              304NotModified
          200OK
          ETag:abcdef012345
Rails: fresh_when
class FooController  Application

 def show
  @foo = Foo.find(params[:id])
  fresh_when :etag = @foo,
    :last_modified = @foo.updated_at.utc
 end

end
Rails: stale?
class FooController  Application

 def show
  @foo = Foo.find(params[:id])
  modified = @foo.updated_at.utc
  if stale?(:etag = @foo, :last_modified = modified)
    respond_to do |wants|
     # ... normal response processing
    end
  end
 end

end
Sinatra: etag
get '/foo' do
 @foo = Foo.find(params[:id])
 etag @foo.etag

 erb :foo
end
Expiration
    +
Validation
Gateway Cache
Alice                   Backend
Gateway Cache
Alice                                   Backend




        GET /foo
        Host: foo.com
Gateway Cache
Alice                                             Backend




        GET /foo                  GET /foo
        Host: foo.com             Host: foo.com
Gateway Cache
Alice                                                                     Backend




        GET /foo                  GET /foo
        Host: foo.com             Host: foo.com




                                        200OK
                                        Cache-Control:public,max-age=60
                                        ETag:abcdef012345
Gateway Cache
Alice                                                                                      Backend




        GET /foo                                   GET /foo
        Host: foo.com                              Host: foo.com




             200OK                                       200OK
             Cache-Control:public,max-age=60             Cache-Control:public,max-age=60
             ETag:abcdef012345                           ETag:abcdef012345
Gateway Cache
Bob   (30 seconds later)                   Backend
Gateway Cache
Bob   (30 seconds later)                   Backend




      GET /foo
      Host: foo.com
Gateway Cache
Bob   (30 seconds later)                                Backend




      GET /foo
      Host: foo.com




            200OK
            Cache-Control:public,max-age=60
            ETag:abcdef012345
            Age:30
Gateway Cache
Carol   (60 seconds later)                   Backend
Gateway Cache
Carol   (60 seconds later)                   Backend




        GET /foo
        Host: foo.com
Gateway Cache
Carol   (60 seconds later)                                           Backend




                                       GET /foo
        GET /foo                       Host: foo.com
        Host: foo.com                  If-None-Match: abcdef012345
Gateway Cache
Carol   (60 seconds later)                                                      Backend




                                       GET /foo
        GET /foo                       Host: foo.com
        Host: foo.com                  If-None-Match: abcdef012345




                                              304NotModified
                                              Cache-Control:public,max-age=60
Gateway Cache
Carol   (60 seconds later)                                                                   Backend




                                                    GET /foo
        GET /foo                                    Host: foo.com
        Host: foo.com                               If-None-Match: abcdef012345




              200OK                                        304NotModified
              Cache-Control:public,max-age=60              Cache-Control:public,max-age=60
              ETag:abcdef012345
Never Generate The
Same Response Twice
use Rack::Cache
$ gem install rack-cache



config.middleware.use Rack::Cache,
 :verbose       = true,
 :metastore      = quot;file:/var/cache/rack/metaquot;,
 :entitystore = quot;file:/var/cache/rack/bodyquot;,
 :allow_reload = false,
 :allow_revalidate = false
High Performance
 Caches/Accelerators

•Squid
 http://www.squid-cache.org/

• Varnish
 http://varnish.projects.linpro.no/
Heroku
Thanks!

Más contenido relacionado

Destacado

Caching the Uncacheable [Long Version]
Caching the Uncacheable [Long Version]Caching the Uncacheable [Long Version]
Caching the Uncacheable [Long Version]Fastly
 
Advanced Caching Concepts @ Velocity NY 2015
Advanced Caching Concepts @ Velocity NY 2015Advanced Caching Concepts @ Velocity NY 2015
Advanced Caching Concepts @ Velocity NY 2015Rakesh Chaudhary
 
Network Security 1st Lecture
Network Security 1st LectureNetwork Security 1st Lecture
Network Security 1st Lecturebabak danyal
 
Digital Must Dos For 2010
Digital Must Dos For 2010Digital Must Dos For 2010
Digital Must Dos For 2010Media Matters
 
Matt Davies Recruiter New 1
Matt Davies Recruiter New 1Matt Davies Recruiter New 1
Matt Davies Recruiter New 1mattmatters
 
Управление реальными инвестициями компании
Управление реальными инвестициями компанииУправление реальными инвестициями компании
Управление реальными инвестициями компанииFormulaS
 
Presentatie huisstijl en website
Presentatie huisstijl en websitePresentatie huisstijl en website
Presentatie huisstijl en websiteMuziekgebouw
 
דברים שכדי לעולם העסקי ללמוד הטור דה פראנס ודבר אחד שלא חומר לאתר
דברים שכדי לעולם העסקי ללמוד הטור דה פראנס ודבר אחד שלא   חומר לאתרדברים שכדי לעולם העסקי ללמוד הטור דה פראנס ודבר אחד שלא   חומר לאתר
דברים שכדי לעולם העסקי ללמוד הטור דה פראנס ודבר אחד שלא חומר לאתרyossi koren
 

Destacado (20)

Caching the Uncacheable [Long Version]
Caching the Uncacheable [Long Version]Caching the Uncacheable [Long Version]
Caching the Uncacheable [Long Version]
 
IOT, Streaming Analytics and Machine Learning
IOT, Streaming Analytics and Machine Learning IOT, Streaming Analytics and Machine Learning
IOT, Streaming Analytics and Machine Learning
 
Building a Smarter Home with Apache NiFi and Spark
Building a Smarter Home with Apache NiFi and SparkBuilding a Smarter Home with Apache NiFi and Spark
Building a Smarter Home with Apache NiFi and Spark
 
Caching on the Edge
Caching on the EdgeCaching on the Edge
Caching on the Edge
 
Advanced Caching Concepts @ Velocity NY 2015
Advanced Caching Concepts @ Velocity NY 2015Advanced Caching Concepts @ Velocity NY 2015
Advanced Caching Concepts @ Velocity NY 2015
 
Network Security 1st Lecture
Network Security 1st LectureNetwork Security 1st Lecture
Network Security 1st Lecture
 
22apr s51-a-sergeev-110426092204-phpapp01
22apr s51-a-sergeev-110426092204-phpapp0122apr s51-a-sergeev-110426092204-phpapp01
22apr s51-a-sergeev-110426092204-phpapp01
 
Комплексный интернет маркетинг
Комплексный интернет маркетингКомплексный интернет маркетинг
Комплексный интернет маркетинг
 
23
2323
23
 
Digital Must Dos For 2010
Digital Must Dos For 2010Digital Must Dos For 2010
Digital Must Dos For 2010
 
в вики Netpromoter2010 ludkevich
в вики Netpromoter2010 ludkevichв вики Netpromoter2010 ludkevich
в вики Netpromoter2010 ludkevich
 
Matt Davies Recruiter New 1
Matt Davies Recruiter New 1Matt Davies Recruiter New 1
Matt Davies Recruiter New 1
 
Garden Spot Village Tour
Garden Spot Village TourGarden Spot Village Tour
Garden Spot Village Tour
 
Управление реальными инвестициями компании
Управление реальными инвестициями компанииУправление реальными инвестициями компании
Управление реальными инвестициями компании
 
Chapter6
Chapter6Chapter6
Chapter6
 
Presentatie huisstijl en website
Presentatie huisstijl en websitePresentatie huisstijl en website
Presentatie huisstijl en website
 
דברים שכדי לעולם העסקי ללמוד הטור דה פראנס ודבר אחד שלא חומר לאתר
דברים שכדי לעולם העסקי ללמוד הטור דה פראנס ודבר אחד שלא   חומר לאתרדברים שכדי לעולם העסקי ללמוד הטור דה פראנס ודבר אחד שלא   חומר לאתר
דברים שכדי לעולם העסקי ללמוד הטור דה פראנס ודבר אחד שלא חומר לאתר
 
货币战争
货币战争货币战争
货币战争
 
Linear equations 2-3
Linear equations   2-3Linear equations   2-3
Linear equations 2-3
 
WE-55-13-1 Space Derby 90-Day
WE-55-13-1 Space Derby 90-DayWE-55-13-1 Space Derby 90-Day
WE-55-13-1 Space Derby 90-Day
 

Último

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.pptxRustici Software
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?Igalia
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyKhushali Kathiriya
 
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...Zilliz
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Jeffrey Haguewood
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsNanddeep Nachan
 
AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024The Digital Insurer
 
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, Adobeapidays
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfsudhanshuwaghmare1
 
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 challengesrafiqahmad00786416
 
A Beginners Guide to Building a RAG App Using Open Source Milvus
A Beginners Guide to Building a RAG App Using Open Source MilvusA Beginners Guide to Building a RAG App Using Open Source Milvus
A Beginners Guide to Building a RAG App Using Open Source MilvusZilliz
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MIND CTI
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)wesley chun
 
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu SubbuApidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbuapidays
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc
 
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...apidays
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...apidays
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDropbox
 

Último (20)

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
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
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...
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectors
 
AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024
 
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
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
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
 
A Beginners Guide to Building a RAG App Using Open Source Milvus
A Beginners Guide to Building a RAG App Using Open Source MilvusA Beginners Guide to Building a RAG App Using Open Source Milvus
A Beginners Guide to Building a RAG App Using Open Source Milvus
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu SubbuApidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 

HTTP's Best-Kept Secret: Caching

Notas del editor

  1. Pure ruby HTTP cache implementation. This talk is not really about Rack::Cache.
  2. Heroku understands HTTP caching.
  3. What we're talking about when we say HTTP caching. There's so many different caching systems.
  4. Page caching, action caching, fragment caching, SQL caching, memcached.
  5. *This* is what we're talking about Wire level Declarative. Don't worry if this doesn't look familiar.
  6. All caches adhere to the same basic rules for the most part.
  7. Or browser cache. People are most familiar with. When we think about HTTP caching, this is what comes to mind. Bandwidth/Traffic Reduction. Number of Clients served by the Cache. I don&#x2019;t want to talk about Client caches.
  8. Many users behind a single cache
  9. Also Known As &#x201C;Reverse Proxy Cache&#x201D;
  10. The reasons have changed over time.
  11. First server, client/browser, and web page Things are good for, like, a year. Ramble about research guys trading papers and linking to each other.
  12. Explosive Netscape goes public in 1995
  13. State of the art Roughly 2.3KB/s Today, yahoo.com homepage is 388K - 2m48s
  14. Other things: CGI just starting out. (Guestbooks, hit counters, search) JavaScript - didn&#x2019;t exist. So what was the most important issue to solve?
  15. Expires Last-Modified
  16. Cache-Control ETag
  17. Much more worried about load on backends. Do less work.
  18. I use ETag and If-None-Match. Last-Modified and If-Modified-Since.
  19. I use ETag and If-None-Match. Last-Modified and If-Modified-Since.
  20. I use ETag and If-None-Match. Last-Modified and If-Modified-Since.
  21. I use ETag and If-None-Match. Last-Modified and If-Modified-Since.
  22. Halts
  23. Requires Rails 2.3+ for Rack/middleware support.