Skip to main content

Tools and config for memcache related caching

Project description

EEA Cache product

This package combines the features from lovely.memcached and plone.memoize.ram. It provides a decorator and utility for Memcaches at EEA. The decorator allows you set dependencies known by lovely.memcached

Contents

Cache decorator

>>> def key(method, self):
...     return method.__name__
>>> from eea.cache import cache
>>> @cache(key, dependencies=["frontpage"])
... def myMethod(num):
...     return num*num

Lets clear any running memcache

>>> from lovely.memcached.event import InvalidateCacheEvent
>>> from zope.event import notify
>>> notify(InvalidateCacheEvent(raw=True, dependencies=['frontpage']))

Our myMethod will now be cached with the key returned from the method ‘key’ and with dependency ‘frontpage’.

>>> myMethod(2)
4
>>> myMethod(3)
4
>>> notify(InvalidateCacheEvent(raw=True, dependencies=['frontpage']))
>>> myMethod(3)
4

Funding

EEA - European Enviroment Agency (EU)

Changelog

4.0 - (2011-11-07)

  • Feature: Plone 4.x compatible release [ghicaale #4309]

0.3 - (2010-11-22)

  • Bug fix: fixed tests namespace in order to be used within hudson [voineali #3821]

0.2 - (2010-11-10)

  • Bug fix: added fake memcache client in order to fix broken doctests [voineali]

0.1 - (2009-11-10)

  • Initial release

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

eea.cache-4.0.zip (15.4 kB view details)

Uploaded Source

File details

Details for the file eea.cache-4.0.zip.

File metadata

  • Download URL: eea.cache-4.0.zip
  • Upload date:
  • Size: 15.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for eea.cache-4.0.zip
Algorithm Hash digest
SHA256 91ce7c23ede820753f3e5858c780a2e14a95a3d6fcb6a6c6487c4dab361f21c8
MD5 50890d137fb22b1a164f2b71c4cc8990
BLAKE2b-256 618a255bf329ef2cb95ddebebed7ac85ea78e1fe570fea43c962c0c417c36c25

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page