Increment page view counter even if page is cached
Adding cache to web pages is usually a good practice; however, making all the content static prevents you from adding some functionalities. A common case is when you need to increment a counter every time a cached resource is viewed.
Ubiquo Widgets expiring cache policy
With ubiquo it's quite easy to expire cached data of a widget after a given time. By defining the expires_in clause in the configuration policy file ("config/initializers/design_cache.rb") we can set the time to live (in seconds) of the cached object. Each widget should have it's own expiring configuration if needed. Another way of expiring cached data is using a system cron job.
Filed under //
ruby caching update_counters rails
Comments [0]