Reputation: 21
'm facing an issue with the Pagy gem in my Ruby on Rails application, where the HTTP cache does not expire when records are updated on pages other than the first page. Specifically, when any records from pages other than the first page get updated, the cache for those pages does not seem to expire or refresh. As a result, users still see outdated records when navigating through the paginated pages, even though the database records have been updated.
@pagy, @records = pagy(@records, items: 8)
fresh_when etag: @records.maximum(:updated_at), last_modified: @records.maximum(:updated_at), public: true
On page first its working fine when I went to page second It do not get expire then I have to do hard reload then updated data start showing on second page
I tried to concatenate the page number in the etag as well but it does not work for me
Upvotes: 2
Views: 60