Mailing List: https://groups.google.com/forum/#!forum/bettercache
## Better Cache
Better Cache is a replacement for the default cache template tag library from Django.
It is a better version of {% cache %}
What is better about Better Cache?
- Nested cache fragments inherit the variables their parent fragments key on
- Parent cache fragments can be given additional keys by their child cache fragments
An example:
{% cache 500 "outer" x %}
y = {{ y }}<br />
{% cache 500 "inner" y %}
x = {{ x }}<br />
{% endcache %}
{% endcache %}
In the default {% cache %} tag from Django, the inner fragment will not be
rerendered when x changes, because only the outer fragment uses that as a key
variable. The outer fragment will not update with y changes, because only the
inner fragment uses that.
With Better Cache, x and y affect both, so fragments will be re-rendered when
any important variable changes.
Better Cache also allows a syntax of giving defaults to key variables:
{% cache 500 "test" x=10 %}
### Controlling inheritence
You don't always want the outer cache fragments to invalidate when variables
only important to the inner fragment changes. In some cases, the inner fragment
is allowed to get stale if it stays cached longer as part of the parent, so
we want a way to disable the inheritence of the variables.
You can do this with the `local` modifier. All modifiers after the `local` will
affect only this cache fragment, not its parent.
{% cache 500 "outer" x %}
y = {{ y }}<br />
{% cache 500 "inner" local y %}
x = {{ x }}<br />
{% endcache %}
{% endcache %}
### Plans
- on-demand invalidation of fragments based on mappings through an ORM-like interface
Metadata
Release files for bettercache 0.7
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| bettercache-0.7.tar.gz | 22.8 kB | Without provenance | Details for bettercache-0.7.tar.gz |
Release files / bettercache-0.7.tar.gz
| Download URL | bettercache-0.7.tar.gz |
|---|---|
| Size | 22.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
66f5b8e562fcf6cb89a56adb2b2f792692c1b3e88e5771283c215e9085ba5182
|
|
BLAKE2b-256 checksum How to use checksums |
e5601f3ae000118d9f215cb5889c3ada7631a386adcba6f7127f691e8597d4ee
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Security for bettercache 0.7
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.
To learn more about protecting yourself from malicious actors, visit our package security documentation.