I've been using an edge version of merb from two or three months ago.
I recently noticed an odd problem when using page and action caching.
I have a class Car with
cache :index, :show
in the controller.
In init.rb,
register(:page_store,
Merb::Cache::PageStore[Merb::Cache::FileStore], :dir => Merb.root /
"public")
register(:action_store,
Merb::Cache::ActionStore[Merb::Cache::FileStore], :dir => Merb.root /
"tmp")
register(:default,
Merb::Cache::AdhocStore[:page_store, :action_store])
After a server restart, pages requested with the show action get file
cached as expected:
http://localhost/cars/1 -> /public/1.html
http://localhost/cars/2 ->/public/2.html
http://localhost/cars/3 -> /public/3.html
However, after a few more such requests
http://localhost/cars/4 -> /public/4.html
/public/4.html has the content of some other similar request, say
3.html
All subsequent such requests have the content of 3.html whatever the
id.
In /tmp, I see
/tmp/Cars#show
with the content of 3.html
I fixed this by omitting action cache:
register(:page_store,
Merb::Cache::PageStore[Merb::Cache::FileStore], :dir => Merb.root /
"public")
register(:default, Merb::Cache::AdhocStore[:page_store])
Is this a bug or am I misunderstanding the cache and coding
incorrectly?
TIA
--
You received this message because you are subscribed to the Google Groups
"merb" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to [email protected].
For more options, visit this group at http://groups.google.com/group/merb?hl=en.