Ix Techau
Ix Techau

Reputation: 71

Rails fragment caching not working locally

I've added the following at the top of my index.html.haml:

- cache do

  content

And as far as I can see, the content is not cached. My server output shows that when I reload the page, it still fetches all the info from the database again.

I haven't tried on live as I don't want to push anything before it's 100% working. What am I doing wrong? Am I not understanding how it's supposed to work? I've set the config.action_controller.perform_caching = true.

Upvotes: 1

Views: 460

Answers (1)

I am PK
I am PK

Reputation: 6764

cache_store configures which cache store to use for Rails caching so you need to specify that

You need to set cache store in general config.

config.cache_store = xyz,abc       # PUT THIS 

Options that you can set:

 :memory_store, :file_store, :mem_cache_store

Upvotes: 6

Related Questions