Skip to main content

Cache Fn

Use django cache to cache the function(*arg, **kw) with timeout.

Quick start

  1. Install::
   pip install django-cache-fn
  1. Start to use it in code
   from cache_fn.decorators import cache_fn

   @cache_fn(prefix='myprefix', timeout=3600)
   def foo(k1, k2):
      return "%s %s"%(k1, k2)

Usage

def cache_fn(timeout=1, prefix=None, cache_ttl=MEMCACHE_MAX_EXPIRATION):
    """
    Retrieve data from cache if cacheable and no-stale,
    otherise refresh synchronously and cache it.
    * timeout: The stale timeout which would be handled in the decorator.
    * prefix: The prefix of cache key.
    * cache_ttl: The TTL(time to live) of key in memcache.
    NOTE: For HttpResponse, we just cache the response whose status code is 200.
    """

Metadata

Release files for django-cache-fn 1.1

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

Source distribution (sdist)

Source distribution for django-cache-fn 1.1
File Size Uploaded Provenance
django-cache-fn-1.1.tar.gz 3.8 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for django-cache-fn 1.1
File Interpreter ABI Platform
django_cache_fn-1.1-py3-none-any.whl Python 3 none any Details

Total release size: 8.5 kB

Release files / django-cache-fn-1.1.tar.gz

Download URL django-cache-fn-1.1.tar.gz
Size 3.8 kB
Tags Source
SHA-256 checksum
How to use checksums
b8c42f83611dcbfc94c5aa7813e46eb346893458e318a9c1dbc7e29889284f99
BLAKE2b-256 checksum
How to use checksums
309ef4212d4590d91cd65e186ddf67feca1736d0e6b98058ced4422dc7e10442
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.29.1 CPython/3.6.5

Release files / django_cache_fn-1.1-py3-none-any.whl

Download URL django_cache_fn-1.1-py3-none-any.whl
Size 4.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
0c4fec03c9f660cb5500b23840bf122eb0c6f6fd6987af2e7c30f34ab6ffa36a
BLAKE2b-256 checksum
How to use checksums
36199469cd363747f06e5befaaa3add0b4637cf2729d3f61c813364d852513f0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.29.1 CPython/3.6.5

Security for django-cache-fn 1.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

Release history Release notifications | RSS feed

This release

1.1 This release

2 release files No provenance

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