Code

Changes between Initial Version and Version 9 of Ticket #19949


Ignore:
Timestamp:
08/24/13 11:17:02 (8 months ago)
Author:
ramiro
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #19949

    • Property Status changed from new to closed
    • Property Cc Kronuz added
    • Property Patch needs improvement unset
    • Property Component changed from Uncategorized to Template system
    • Property Resolution changed from to fixed
    • Property Needs tests unset
    • Property Owner changed from nobody to susan
    • Property Keywords templates cache added
    • Property Needs documentation unset
    • Property Has patch set
    • Property Type changed from Uncategorized to Cleanup/optimization
    • Property Triage Stage changed from Unreviewed to Accepted
  • Ticket #19949 – Description

    initial v9  
    11In cases where multiple fallback templates are requested to the template loader (i.e. `django.template.loader.select_template()`) to find the first one available, the cached template loader does not cache non-existent templates, making cached loader "slow" again if every time it has to try looking for a template that's been already found to be missing. 
    22 
    3 `` 
     3{{{ 
    44from django.template.loader import render_to_string 
    55render_to_string(['missing_template_1.html', 'missing_template_2.html', ..., 'missing_template_N.html', 'existent_template.html']) 
    6 `` 
     6}}} 
    77 
    88When using `django.template.loaders.cached.Loader`, and given that snippet above, and the fact that `missing_template_1.html` ... `missing_template_N.html` do not exist, the filesystem loader or other loaders get hit every time (trying and trying to find already known as missing templates).