A Customized Approach to HTTP Proxy Caching in Ruby

  • View
    232

  • Download
    0

Embed Size (px)

Text of A Customized Approach to HTTP Proxy Caching in Ruby

  • Perry Carbone

    Github: github.com/perrycarboneTwitter: @perrycarbone

    A Customized Approach to HTTP Proxy Caching in Ruby

    https://github.com/perrycarbone

  • An HTTP proxy caching gem for Rack-based Ruby applications

    https://github.com/acorncache/acorn-cache

    Co-Authors: Perry Carbone; Vince Devendra

    https://github.com/acorncache/acorn-cache

  • The Goals of HTTP Caching

    Decrease page load times and the burden on your server

  • Two Types of HTTP Caching

  • Client (Browser) Caching

    Internet

    Web Server

    Cached data

    stored

    here

  • Proxy Caching

    Internet

    Application Server

    Cached data

    stored

    here

    Proxy Cache

    Server

  • Where Does AcornCache Fit In?

    Internet

    Client Client Client

  • Middleware Stack ExampleIncoming Request

    AcornCache

    Middleware 2

    Middleware 3..n

    Application

    Outgoing Cached Response

    Server Response

    Request

  • Middleware Stack ExampleIncoming Request

    AcornCache

    Middleware 2

    Middleware 3..n

    Application

    Outgoing Server Response

    Server Response

    Request

  • Why Did We Build It?

    +

    =

  • Does it Work?

  • Does it Work?

  • Does it Work?

    Complexity

    Request Time

    With Acorn Cache

    Without A

    cornCac

    he

  • Getting Started

    CACHE ALL THE THINGS!

  • What to Cache With?

  • Rack::AcornCache

    Cached Response

    Server Response Request

    Initial Object Model

  • Respecting Cache Control Headers

    This should be easy, right?

  • Rack::AcornCache

    Expanded Object Model

    Cache Controller

    Cache Maintenance

    Cached Response

    Cache Control Header

    Server Response

    Cache Control Header

    RequestCache Control

    Header

  • Thinking About Thread Safety

  • Exception Handling

    Because SometimesThere Are Unforeseen

    Complications

  • Exception Handling

  • Allowing for Customization

    Implement Page Rules

  • Pure Ruby FTW

  • Future Plans

  • An HTTP proxy caching gem for Rack-based Ruby applications

    https://github.com/acorncache/acorn-cache

    Please Contribute!

    https://github.com/acorncache/acorn-cache

  • Perry Carbone

    Github: github.com/perrycarboneTwitter: @perrycarbone

    Email: perrycarb@gmail.com

    Looking for Work!

    https://github.com/perrycarbone