Rails 4 - Why am I still seeing faster load times even though I have caching turned off?

102 views Asked by At

I am in the process of implementing basic remote caching on Rails 4, and I am having trouble determining if it is truly working.

My setup is as follows:

  • Amazon EC2 instances for web/app/db layers plus a specific ec2 instance for memcached.
  • RoR with Nginx, Unicorn and MySQL
  • Dalli gem (default with Rails 4)
  • Capistrano gem for deployment
  • New Relic for metric gathering
  • I also defined my own "staging" rails_env that deploys to AWS

My question: I have been changing the caching configurations inside my own /config/environments/staging.rb (since I defined my own rails_env) and I am not seeing any significant differences in performance with caching on and off.

Ex. With caching on, a page would take ~200ms on initial load and ~15ms on subsequent loads.

Following the RoR guide, I turned off caching by setting

config.action_controller.perform_caching = false

config.cache_store = :null_store

which was

config.cache_store = :mem_cache_store, "www.mymemcachedserver.com"

before.

With caching off, I was expecting the same pages to take ~200ms on each load, but I am seeing the exact same numbers (200ms before, 15ms after). Is there something that I'm missing? Did I have caching working in the first place?

I also tried directly accessing the site from the app layer (sans CSS & other assets) and got similar results - so is there other sources of caching that I am missing? Could it be related to the database or even my browser caching previous pages (ie Chrome, Firefox)?

Thanks in advance!

0

There are 0 answers