Closed encukou closed 7 years ago
When freezing the index.txt
has colorized header while it shouldn't have:
When just serving, I see the following behavior:
And:
Is there some automagic caching involved?
@app.template_filter('term_color')
def term_color(text, color):
print(g.colors)
if g.colors:
...
False printed 22 times
127.0.0.1 - - [07/Aug/2017 16:59:15] "GET /index.txt HTTP/1.1" 200 -
True printed 17 times
127.0.0.1 - - [07/Aug/2017 16:59:24] "GET /index.term HTTP/1.1" 200 -
False printed 17 times
127.0.0.1 - - [07/Aug/2017 17:00:10] "GET /index.txt HTTP/1.1" 200 -
Setting app.jinja_env.cache = None
disables the cache and workarounds the issue.
However, if there is a way to either not use the g
or mark that part of the template as not cachable or similar, I'd rather use that.
Thanks for the review! The jinja caching surprised me. I pushed fixes that should address your points.
Ah, I see what you meant. That's what I get for testing with less...
I'd like to use some representative content in demos. Why not F♥P talking points?
This adds endpoints showing the data as JSON, text, and text with terminal color sequences.