1

I have a Rails 3 application that uses the Dalli gem to manage its cache.

I need to check if a certain part of the application is setting the expiration date of the cache correctly, but can't find a way to manually check that on a specific fragment.

I found this answer, but it doesn't work with Dalli.

Is there another way?

Community
  • 1
  • 1
João de Paula
  • 123
  • 1
  • 7

1 Answers1

0
  1. You have a mistake when use read_entry method.

    Rails.cache.send(:read_entry,'cache/entry/key',{})
    

    The 'cache/entry/key' should not begin with the namespace.

    for example:

    The namespace is 'aaa', the key is 'aaa:a_key_name', then the 'cache/entry/key' should be 'a_key_name'.

  2. this script may work: https://gist.github.com/bkimble/1365005

user229044
  • 232,980
  • 40
  • 330
  • 338
fantaxy025025
  • 809
  • 8
  • 7