Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clean up template rendering code #3923

Closed
amercader opened this issue Nov 16, 2017 · 2 comments
Closed

Clean up template rendering code #3923

amercader opened this issue Nov 16, 2017 · 2 comments
Assignees

Comments

@amercader
Copy link
Member

ckan.lib.base.render() is a mess of old code that is probably no longer used. Now that we are starting to port Pylons controllers to Flask in earnest is the perfect time to do a long overdue cleanup.

The Canadian open data portal has been running for a while in a extremely simplified version of it. @wardi and @TkTech provided context in this IRC conversation.

Essentially:

I'm happy to keep all current stuff in a _render_template_pylons() function and have the cleaned up version just apply to Flask

@amercader amercader self-assigned this Nov 16, 2017
smotornyuk added a commit to smotornyuk/ckan that referenced this issue Jan 8, 2018
@smotornyuk
Copy link
Member

For simplicity, all existing caching logic from render will be moved to separate function called only for pylons' routes, thus it can be safely dropped after finishing flask migrations.

In addition:

  • enable Jinja2's bytecode cache
  • leave cache size with default value(it already increased inside Jinja2 itself)
  • completely remove PageCacheMiddleware. First reason for this - it wasn't used for rendering snippets and extended templates, so profit of using it is quite small. In addition, it seems that most of CKAN users configure different variations of caching using separate tools(ex. serving over nginx)

amercader added a commit that referenced this issue Jan 22, 2018
@amercader
Copy link
Member Author

Fixed in #3979

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants