I should add that don't seem to see this problem with bin/merb but do see it with my nginx+passenger setup. I just recompiled both the latest versions and still see the problem. The nginx server is in production so sees a lot more traffic than my casual hand testing with bin/merb.
The nginx.conf is basic and shouldn't directly cause this problem. Seems that somehow merb-cache decides at some point action cache would be faster for car show and takes a snapshot with a particular id and freezes that in the cache. Caching show action for something that depends on an id is meaningless anyway, no? On Mon, Apr 19, 2010 at 4:42 PM, Ming <[email protected]> wrote: > 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.
