Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/dux/xcache
cache helper for rails
https://github.com/dux/xcache
Last synced: about 2 months ago
JSON representation
cache helper for rails
- Host: GitHub
- URL: https://github.com/dux/xcache
- Owner: dux
- License: mit
- Created: 2011-04-01T01:39:02.000Z (almost 14 years ago)
- Default Branch: master
- Last Pushed: 2011-04-02T17:20:53.000Z (almost 14 years ago)
- Last Synced: 2023-03-24T05:21:54.607Z (almost 2 years ago)
- Language: Ruby
- Homepage:
- Size: 93.8 KB
- Stars: 2
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.markdown
- License: MIT-LICENSE
Awesome Lists containing this project
README
xCache
============Rails cache helper. Binds to models, invalidates on object update and helps vith etag cacheing
Models would idealy have updated_at field. If they have it, update invalidates cache, automaticly.
If there is no updated_at fields invalidate with calling @object.xcache
Example
=======Examples say it all
Full HAML example, view
=================
- xcache @product do
foo- xcache @product :list_item do
fooIn controller for cache invalidation
====================================
@product.xcache # clears cache for objectIn controller for fresh_when helper
===================================
return if xcache @product, @user, @foo, ....Send list of objects. plugin finds last updated time, checks browser cache time and serves from browser cache unless modfied
http://www.checkupdown.com/status/E304.htmlHow many functions I have to remember? Just 1, there is one function "xcache" to dominate all usage
- in template replaces cache tag
- as model instance method, clears model cache
- as controller method helps with rails fresh_when methodCopyright (c) 2011 [Dino Reic (dux)], released under the MIT license
http://twitter.com/dux