Fantomas42 / django-blog-zinnia

Simple yet powerful and really extendable application for managing a blog within your Django Web site.
http://django-blog-zinnia.com/
BSD 3-Clause "New" or "Revised" License
2.11k stars 730 forks source link

HTML generated from markup source is not cached, leading to performance issues #571

Open delroth opened 4 years ago

delroth commented 4 years ago

Actual behavior

(This is more of a feature request / performance optimization thing than an actual bug report.)

Zinnia seems to perform no caching of the markup rendering for blog entries. This rendering can be quite expensive especially with:

  1. Large articles (5K+ words)
  2. Syndication feeds, which end up re-rendering many articles on each request (and AFAICT there is no django caching happening at the view layer either).

We've been using Zinnia for the development blog on dolphin-emu.org for quite a while, but recently we've started hitting more and more performance issues due to this behavior. We've had at least one outage caused by multiple clients requesting syndication feeds around the same time and hogging all of the CPU converting markdown to HTML.

Expected behavior

It would probably make sense to keep a cached version of the rendering inside the entry model. This would increase database size, but greatly improve rendering time (basically free).

Steps to reproduce the issue

  1. Add 10+ large blog entries in markdown or any other markup language
  2. Send a lot of requests to /feeds/
  3. Notice the high amount of CPU time wasted.

Specifications

Disclaimer

Before submitting an issue make sure you have:

elarroba commented 2 years ago

@delroth

I just created a fork of this project and updated the code to work with modern versions of Django (including 4.0+).

Please visit https://github.com/arrobalytics/django-blog-zinnia if you want to contribute. Don't forget to star the project to show your support.

Visit the new site https://www.djangoblogzinnia.com for documentation, demo and other resources.