Managing urls in the manifest¶
Sometimes you don’t want urls to be cached for various reasons (they can pull content from external sites with no way to invalidate the local cache, or they are just non meant to be available offline), or you want to insert non-discoverable urls in it.
As there is not one-size-fit-all in managing urls in manifest,
django-html5-appcache offers different methods to get the urls in or out
of the manifest file to meet as many usecases as possible.
Via AppCache class¶
AppCache classes, is it possible to override methods to fine-tune
the urls in each section of the manifest file:
In the Markup¶
sitemap discovery, by default
every relative URL is considered to be cached, while external URLs are not cached.
It’s possible to control the behavior of each url by using custom attributes
in your tags.
link tag, you can add data-attributes to
control how each referenced url is considered:
data-appcache='appcache': the referenced url is added to the CACHE section
data-appcache='noappcache': the referenced url is added to the NETWORK section
data-appcache-fallback=URL: the referenced url is added in the FALLBACK section, with URL as a target