#29562: An idea for improving the template fragment cache
-------------------------------------+-------------------------------------
     Reporter:  HongWeipeng          |                    Owner:  nobody
         Type:  New feature          |                   Status:  new
    Component:  Core (Cache system)  |                  Version:  master
     Severity:  Normal               |               Resolution:
     Keywords:                       |             Triage Stage:
                                     |  Unreviewed
    Has patch:  0                    |      Needs documentation:  0
  Needs tests:  0                    |  Patch needs improvement:  0
Easy pickings:  0                    |                    UI/UX:  0
-------------------------------------+-------------------------------------
Description changed by HongWeipeng:

Old description:

> 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.
>
> 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]

New description:

 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]

--

-- 
Ticket URL: <https://code.djangoproject.com/ticket/29562#comment:1>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/069.5ab6f3f9f095b1219496cdbdf63f5a0b%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to