فشرده سازی فایلهای html in django

HTML minifier امیدوارم روزی بکارتون بیاد

image

Why minify HTML code?
One of the important points on client side optimization is to minify HTML. With minified HTML code, you reduce the size of the data transferred from the server to the client, which results in faster load times.

نحوه راه اندازی

  1. env
    $ [sudo] pip install django-htmlmin

  2. settings.py

MIDDLEWARE_CLASSES = (
    # other middleware classes
    'htmlmin.middleware.HtmlMinifyMiddleware',
    'htmlmin.middleware.MarkRequestMiddleware',
)

HTML_MINIFY = True

پایان :partying_face:

3 پسندیده