Skip to main content

Easy to Use

# ==================== 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

$ pip install Flask-Dogpile-Cache

Release files for Flask-Dogpile-Cache 0.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for Flask-Dogpile-Cache 0.2
File Size Uploaded
Flask-Dogpile-Cache-0.2.tar.gz 6.4 kB Details

Release files / Flask-Dogpile-Cache-0.2.tar.gz

Download URL Flask-Dogpile-Cache-0.2.tar.gz
Size 6.4 kB
Tags Source
SHA-256 checksum
How to use checksums
4304cd647e0b54cfecb82d32f4ac69995c514686d75b364b7de40f13897891f6
BLAKE2b-256 checksum
How to use checksums
0d436c0898096fd0ad31e3576a92d1f1ddd05f23bdd1e4791eee841441214dbf
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release history Release notifications | RSS feed

This release

0.2 This release

1 release file

0.1.4

1 release file

0.1.3

1 release file

0.1.2

1 release file

0.1.1

1 release file

0.1

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page