Opened 6 years ago

Last modified 6 years ago

#29562 closed New feature

An idea for improving the template fragment cache — at Version 1

Reported by: HongWeipeng Owned by: nobody
Component: Template system Version: dev
Severity: Normal Keywords:
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description (last modified by HongWeipeng)

There is a problem in using template fragment caching, that is, we need transfer data for template every time, even the data has been in cache.

If the data acquisition process is time consuming (such as 3 seconds), template caching has no helpful.

My idea is to allow provide a callback function to tell the cache how to get the data. and only call the function when cache expires.

Although custom tags can be used to get the data in the cache, custom tags don't seem to handle html code very well.

I have tried it many times and found out how to make the simplest changes to complete this feature and ensure its compatibility.

Can you see this RP please? https://github.com/django/django/pull/10176

Change History (1)

comment:1 by HongWeipeng, 6 years ago

Description: modified (diff)
Note: See TracTickets for help on using tickets.
Back to Top