Metadata-Version: 1.1
Name: Flask-Dogpile-Cache
Version: 0.2
Summary: Adds dogpile.cache support to your Flask application
Home-page: http://bitbucket.org/ponomar/flask-dogpile-cache
Author: Vitalii Ponomar
Author-email: vitalii.ponomar@gmail.com
License: BSD
Description: Flask-Dogpile-Cache
        -------------------
        
        
        Easy to Use
        ```````````
        
        .. code:: python
        
            # ==================== config.py ====================
        
            DOGPILE_CACHE_URLS = ["127.0.0.1:11211"]
            DOGPILE_CACHE_REGIONS = [
                ('hour', 3600),
                ('day', 3600 * 24),
                ('month', 3600 * 24 * 31),
            ]
            # Default settings:
            # DOGPILE_CACHE_BACKEND = 'dogpile.cache.memcached'
        
        
            # ==================== app.py ====================
        
            import config
            from flask import Flask
            from flask.ext.dogpile_cache import DogpileCache
        
            app = Flask(__name__)
            app.config.from_object(config)
        
            cache = DogpileCache()
            cache.init_app(app)
            # Alternative way: cache = DogpileCache(app)
        
            @cache.region('hour')
            def cached_func(*args):
                print "Heavy computation here", args
                return args
        
            value = cached_func()
        
            cache.invalidate(cached_func, *args)  # Invalidating cache for cached_func
            cache.refresh(cached_func, *args)     # Refreshing cache for cached_func
            cache.set(cached_func, value, *args)  # Setting custom value for cached_func
            cache.invalidate_region('hour')       # Invalidate cache for all funcs
                                                  # decorated with @cache.region('hour')
            cache.invalidate_all_regions()        # Invalidate cache for all funcs
                                                  # decorated with @cache.region
        
        
        Easy to Install
        ```````````````
        
        .. code:: bash
        
            $ pip install Flask-Dogpile-Cache
        
        Links
        `````
        
        * `development version
          <http://bitbucket.org/ponomar/flask-dogpile-cache>`_
        
Keywords: caching flask dogpile
Platform: any
Classifier: Development Status :: 4 - Beta
Classifier: Environment :: Web Environment
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: BSD License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python
