Skip to main content

A microlibrary to ease cache storage and retrieval

Project description


A microlibrary to ease your caching code.


def key_function(arg1, arg2):
    return f"prefix.{arg1}.{arg2}"

def some_function(arg1, arg2):
    return "COMPLEX DATA"

Normal usage:

value = some_function(1, 2)

Skipping the cache:

value = some_function.bypass_cache(1, 2)

Updating the cache:

value = some_function.refresh_cache(1, 2)

Fetch the key for manual action:

cache_key = some_function.cache_key(1, 2)


Install the module from PyPI:

pip install django-cache-results

And use it in your project:

from cache_results import cache_results


Was there something you missed, or didn’t like about this module? Send us a pull request!

Project details

Release history Release notifications | RSS feed

This version


Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor NVIDIA NVIDIA PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page