16. Orient
Page Caching
Fragment Caching
Action Caching
Database Caching
17. Decide
Por ejemplo:
To cache the landing page, or
articles, or products
Or
All of the above
18. Act
class ProductsController < ApplicationController
caches_page :index, :show
def index
@products = Product.page(params[:page]).per_page(10)
end
def show
@product = Product.find(params[:id])
end
# Other actions omitted.
end
19. Act
class ProductSweeper < ActionController::Caching::Sweeper
observe Product
def after_update(product)
expire_page products_path
expire_page product_path(product)
expire_page "/"
FileUtils.rm_fr "#{page_cache_directory}/products/page"
end
end
28. [Miz on plas]
Mise en place (pronounced [miz on plas],
literally "putting in place") is a French phrase
defined by the Culinary Institute of America as
"everything in place", as in set up. It is used
in professional kitchens to refer to organizing
and arranging the ingredients (e.g., cuts of
meat, relishes, sauces, par-cooked items,
spices, freshly chopped vegetables, and other
components) that a cook will require for the
menu items that he or she expects to prepare
during his/her shift.[1]
29. GT mise en place
What might our developer kitchen look like?
Our staging kitchen?
Our production kitchen?
34. Development kitchen
Apache bench
$ ab -n 5 -c 5 http://127.0.0.1:3000/articles
-n requests is the number of requests
-c concurrency is the number of multiple requests
52. To be answered:
1) Do we turn caching on in
development?
2) Do we run tests against caching
before pushing?
3) Do we accept features that
haven't passed caching?