##Built-in Rails/Gems
[0] Rails guide to caching in rails - read this first http://guides.rubyonrails.org/caching_with_rails.html
Heroku Guide to Caching Strategies for Rails - read this second https://devcenter.heroku.com/articles/caching-strategies
[1] Countercache in ActiveAssocation http://yerb.net/blog/2014/03/13/three-easy-steps-to-using-counter-caches-in-rails/
But only for aggregate values Upgrade to regular AR counter-caching https://github.com/magnusvk/counter_culture
[2] HTTP Caching
https://developers.google.com/web/fundamentals/performance/optimizing-content-efficiency/http-caching "each server response provides the correct HTTP header directives to instruct the browser on when and for how long the browser can cache the response."
Heroku guide to implement: https://devcenter.heroku.com/articles/http-caching-ruby-rails Good news: already basically/simply enabled in Rails 3+ Why would use this gem instead of Rails default? https://github.com/rtomayko/rack-cache hmmm
NOOP: In computer science, a NOP or NOOP (short for No Operation) is an assembly language instruction, programming language statement, or computer protocol command that does nothing.
[3]"blob level caching plugged into ActiveRecord" https://github.com/Shopify/identity_cache
What does this mean?
Fetch the images for the Product. Images are embedded so the product fetch would have already loaded them.
@images = @product.fetch_images
this looks nice
class Product < ActiveRecord::Base
include IdentityCache
has_many :images
has_one :featured_image
cache_has_many :images
cache_has_one :featured_image
end
@product.fetch_featured_image
@product.fetch_images
can cache just attributes as well