rails expiring cache -


I've used data in a table using the migration to add some data. When I update, add, delete the product from this table, I need to expire the page and piece cache. I made a clean worker for this.

  Class ProductSweeper & lt; ActionController :: Caching :: Sweeper Inspection Product Def expire_cache end afterwardscreate DEF expire_cache end after_save def expire_cache end after_update def expire_cache end personalized after_destroy def expire_cache expire_page (: Controller => 'ProductsController',: action => 'index' ) Expire_fragment 'listed_products' and end  

Then in the script / console I update the product name and save it. When I load my app again in the browser it still gives me a cache hit

Hit the cached piece. Thoughts / listed_products (0.2ms)

Can anyone tell me to end this cash? I will not be adding, updating, removing products through a controller action

Thanks, ash

More information:

  & lt; Div & gt; & Lt;% cache 'listed_products%' & gt; & Lt;% = Render: Partial = & gt; "/ Layout / product" ,: collection = & gt; Product. Listed_products% & gt; & Lt;% end% & gt; & Lt; / Div & gt;  

Here's partial.

  & lt; Ul class = "vlist" & gt; & Lt; Li & gt; & Lt; Div class = "flight bone" & gt; & Lt;% = h product.name% & gt; & Lt; / Div & gt; & Lt; Div class = "freight bone" & gt; & Lt;% = h product.cal_date.strftime ("% b% d,% Y")%> & Lt; / Div & gt; & Lt; / Li & gt; & Lt; / Ul & gt;  


Comments

Popular posts from this blog

windows - Heroku throws SQLITE3 Read only exception -

lex - Building a lexical Analyzer in Java -

python - rename keys in a dictionary -