0

I am deploying all my assets on s3, and pre-compiling them on deployment. In theory sprockets shouldn't really do anything during runtime.

However, when I debug my cache I keep seeing some sprockets activity: cache miss: sprockets/dbc38e827b53b65e2f3840f004685b57 (0.7ms) cache hit: sprockets/bd37d101b41cff7ff25f3a3492a8cd6e (0.1ms)

Any ideas?

Is it possible that rails uses sprockets to resolve the asset path, and every time a new path gets resolved it caches it?

EugeneMi
  • 3,475
  • 3
  • 38
  • 57

1 Answers1

1

Make sure you disable the asset pipeline in your production environment. Inside your production.rb:

# Compress JavaScripts and CSS
config.assets.compress = true

# Don't fallback to asset pipeline if a precompiled asset is missed
config.assets.compile = false

Check out the example production.rb in Rails Asset Pipeline guide.

Ross Allen
  • 43,772
  • 14
  • 97
  • 95