views:

304

answers:

1

Hello,

I have started using Jinja2 as my templating engine on Google App Engine (in Python).

My question is this: Will bytecode caching work in production? It is working very well on the development server, but I read somewhere that bytecode caching depends on the marshal module, which is not supported in App Engine. This answer to a different question provides a possible solution by changing marshal to use pickle methods. Has anyone tried this?

In general, is there anything else that I should take into consideration when using Jinja2 with App Engine?

Any help would be greatly appreciated!

Thanks.

+2  A: 

Rodrigo Moraes created some special loaders for Jinja2 under GAE, see here. It's not bytecode caching but it precompiles all templates to Python so you avoid the Jinja2 parsing overhead.

Note that (from this GAE page):

compiled application code is cached for rapid responses to web requests

Vinay Sajip
I'm just going to go with un-cached templates for now. I'll take a closer look when I have more time to delve into the code. Thanks for the reply!
Cameron