- ruby 2.2.2p95
- rails 4.2.1
My cache generation is working nincely.
Index Page
http://localhost:3001/produtos
Write fragment views/localhost:3001/produtos (11.0ms)
Pagination Page
http://localhost:3001/produtos/pagina/2
Write fragment views/localhost:3001/produtos/pagina/2 (15.3ms)
But I'm in troubles to expiring them. I'm using a sweeper to expire my action caches and I have not figured out how to expire pagination pages.
class ProductsController < ApplicationControlle
caches_action [:show, :index]
end
class Admin::ProductsController < Admin::BaseController
cache_sweeper :product_sweeper
end
class ProductSweeper < ActionController::Caching::Sweeper
observe Product
def after_save(product)
expire_action products_url
expire_action category_product_url(category_id: product.category.slug)
end
end
How to expire pagination pages
http://localhost:3001/produtos/pagina/2
http://localhost:3001/produtos/pagina/3
http://localhost:3001/produtos/pagina/4
...
and so on?