Skip to main content

UNKNOWN

Project description

Muffin-Cache – A simple cache tools for muffin framework.

Build Status Coverals

Requirements

  • python >= 3.4

  • muffin >= 0.5.5

  • muffin-redis >= 0.3.0

Installation

Muffin-Cache should be installed using pip:

pip install muffin-cache

Usage

Add Muffin-Redis and Muffin-Cache to muffin plugin list:

import muffin


app = muffin.Application(
    'example',

    PLUGINS=(
        'muffin_redis',
        'muffin_cache',
    )
)

And use CacheHandler for class based views:

from muffin_cache import CacheHandler

@app.register('/cached')
class Example(CacheHandler):

    def get(self, request):
        return 'text'

Or cache_view for functions based views:

from muffin_cache import cache_view

@app.register('/cached')
@cache_view
def example(request):
    return 'text'

The cache lifetime is determined by CACHE_LIFETIME setting of muffin application. (the default lifetime is 30 minutes).

Bug tracker

If you have any suggestions, bug reports or annoyances please report them to the issue tracker at https://github.com/drgarcia1986/muffin-cache/issues

Contributing

Development of Muffin-Cache happens at: https://github.com/drgarcia1986/muffin-cache

Contributors

License

Licensed under a MIT license.

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

muffin-cache-0.0.1.tar.gz (4.5 kB view hashes)

Uploaded Source

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