Skip to content

cache/stash long_descriptions rendered by readme_render #3739

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

Closed
ewdurbin opened this issue Apr 17, 2018 · 4 comments · Fixed by #5818
Closed

cache/stash long_descriptions rendered by readme_render #3739

ewdurbin opened this issue Apr 17, 2018 · 4 comments · Fixed by #5818

Comments

@ewdurbin
Copy link
Member

RE pypa/readme_renderer#95

A handful of long descriptions have long render times, such as https://gitlab.com/hansroh/skitai/blob/master/README.rst.

A proposed solution:

  • Store long_description as usual at upload time.
  • Call a task to attempt to render the long description.
  • Task renders long_description and stores resulting html with the version number of readme_renderer
  • When rendering a project page, check for rendered version and fallback to attempting render
  • On readme_renderer upgrade, have some mechanism to rerender all readmes via the same celery task as above.
@ewdurbin
Copy link
Member Author

ewdurbin commented Apr 17, 2018

cc @theacodes

@theacodes
Copy link
Contributor

Research notes (for my own benefit/for the benefit of whoever takes this on):

  1. Current un-rendered description field is here.
  2. The description is only rendered for HTML views and is done in the template here using the readme filter.
  3. The filter readme is defined here.

For the benefit of accomplishing this task and testability, we should likely pull the rendering logic out of the context filter and into its own thing (not sure where they would live yet) and just have the filter be a thin wrapper. We could then use the common function from both the task and the templates.

@di
Copy link
Member

di commented Apr 17, 2018

Might not even be necessary to keep it as a filter, it could be passed into the template from the view instead, which would make it a little easier to determine a cache key.

@theacodes
Copy link
Contributor

That could definitely work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants
@theacodes @di @ewdurbin and others