Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
branch: master

Fetching latest commit…

Octocat-spinner-32-eaf2f5

Cannot retrieve the latest commit at this time

Octocat-spinner-32 app
Octocat-spinner-32 config
Octocat-spinner-32 db
Octocat-spinner-32 doc
Octocat-spinner-32 lib
Octocat-spinner-32 log
Octocat-spinner-32 public
Octocat-spinner-32 script
Octocat-spinner-32 test
Octocat-spinner-32 vendor
Octocat-spinner-32 .gitignore
Octocat-spinner-32 Gemfile
Octocat-spinner-32 Gemfile.lock
Octocat-spinner-32 LICENSE.txt
Octocat-spinner-32 Procfile
Octocat-spinner-32 README.md
Octocat-spinner-32 Rakefile
Octocat-spinner-32 config.ru
README.md

Example App for Heroku

  gem install bundler
  bundle install

Then create a database and run your migrations

  bundle exec rake db:create
  bundle exec rake db:migrate

Create your production database

  bundle exec rake db:create RAILS_ENV=production
  bundle exec assets:precompile

Start your server

  foreman start # production

Visit http://localhost:5000 and view your logs, you should see some cache entries

    cache: [GET /assets/application-193197163ac0c1601c69cbdaf22f6ce6.css] miss, store
    cache: [GET /assets/application-bf044948e75c7535c35baf4b42604116.js] miss, store
    cache: [GET /assets/rails-782b548cc1ba7f898cdad2d9eb8420d2.png] miss, store

Refresh the page and you should see that those entries can be pulled fresh from cache

    cache: [GET /assets/application-193197163ac0c1601c69cbdaf22f6ce6.css] fresh
    cache: [GET /assets/application-bf044948e75c7535c35baf4b42604116.js] fresh
    cache: [GET /assets/rails-782b548cc1ba7f898cdad2d9eb8420d2.png] fresh

When you modify a file such as app/assets/stylsheets/screen.css and run rake assets:precompile and then start and stop your server, you should see that there is now a new digest for the file and it must be stored in cache again.

Rack::Cache

Rack::Cache Metastore

The metastore holds metadata about the objects in cache. Metastore entries are small and accessed frequently. It makes alot of sense to put this data in a fast light datastore such as Memcache

Rack::Cache Entitystore

The entity store is where the objects get cached. Entity store objects are typically large and accessed infrequently. For that reason it might make sense to store them on disk rather than to take up a large amount of room in Memcache.

Contact

Richard Schneeman @Schneems for Heroku.

licensed under MIT License Copyright (c) 2012 Schneems. See LICENSE.txt for further details.

Something went wrong with that request. Please try again.