{ "info": { "author": "Xfenix", "author_email": "ad@xfenix.ru", "bugtrack_url": null, "classifiers": [], "description": "django-hmin\n===========\n\n|Build Status|\n\nDjango (1.6+) HTML minification middleware (another one). Key feature -\nspeed. 10x (on large html's it can be 50x, 100x, 200x or even more) time\nfaster, than htmlmin. Compress html, removes comments, respects (dont\nremove) conditional comments (IE) by default. Uses cache (can be\ndisabled), that greatly reduce html minification overhead.\n\nCompability\n===========\n\nDjango 1.6 - Django 1.10\n\nInstalling\n==========\n\nFor install django-hmin, run on terminal:\n\n::\n\n $ pip install django-hmin\n\nExtra install options\n'''''''''''''''''''''\n\nOptionally, you can install ``re2`` (fast regular expressions) library\n(``pip install re2`` + reqs). Hmin will use it instead of ``re``.\n\nUsing the midleware\n===================\n\nAll you need to do is add two middlewares to your\n``MIDDLEWARE_CLASSES``:\n\n::\n\n MIDDLEWARE_CLASSES = (\n # other middleware classes\n 'hmin.middleware.MinMiddleware',\n 'hmin.middleware.MarkMiddleware',\n )\n\nIf you're using Django's caching middleware, ``MarkMiddleware`` should\ngo after ``FetchFromCacheMiddleware``, and ``MinMiddleware`` should go\nafter ``UpdateCacheMiddleware``:\n\n::\n\n MIDDLEWARE_CLASSES = (\n 'django.middleware.cache.UpdateCacheMiddleware',\n 'hmin.middleware.MinMiddleware',\n # other middleware classes\n 'django.middleware.cache.FetchFromCacheMiddleware',\n 'hmin.middleware.MarkMiddleware',\n )\n\nYou can optionally specify the ``HTML_MINIFY`` setting:\n\n::\n\n HTML_MINIFY = True\n\nThe default value for the ``HTML_MINIFY`` setting is ``not DEBUG``. You\nonly need to set it to ``True`` if you want to minify your HTML code\nwhen ``DEBUG`` is enabled.\n\nURL exclude\n'''''''''''\n\nSpecify setting:\n\n::\n\n HMIN_EXCLUDE = ('^base/', '^admin/')\n\nKeep html comments\n''''''''''''''''''\n\nSpecify settings:\n\n::\n\n HMIN_REMOVE_COMMENTS = False\n\nCache\n'''''\n\nBy default hmin middleware uses cache (very useful for small and middle\nweb sites, and for big you definitely will use ngx\\_pagespeed or other\n\"big\" solutions). You can disable it by specify setting:\n\n::\n\n HMIN_USE_CACHE = False\n\nAlso you can change time and cache backend (if you want, by default time\nis 3600, cache backend - \"default\"):\n\n::\n\n HMIN_CACHE_TIMEOUT = 86400\n HMIN_CACHE_BACKEND = 'my_cache'\n\nUsing the function\n==================\n\nJust import function minify: ``from hmin import minify``, than you can\nuse it with any html you want. Function definition:\n``def minify(content, remove_comments=True)``\n\nUsing the decorator\n===================\n\nJust import decorator minify\\_plain:\n``from hmin.decorators import minify_plain``, than you can minify any\nfunction you want:\n\n::\n\n @minify_plain()\n def my_cool_func():\n <...>\n return some_plain_html\n\nOr, if you want to keep html comments:\n\n::\n\n @minify_plain(False)\n def my_cool_func():\n <...>\n return some_plain_html\n\nStupid speed benchmark (1)\n==========================\n\nI try to compress 1mb of html (i think, your usual html is slightly\nthiner) on my i7 laptop processor and measure time with\ndjango-debug-toolbar.\n\nDjango overhead took about 40ms (all), this is time without\nminification, just plain html, django, etc.\n\nThen i install hmin and htmlmin and just look at the debug toolbar\nnumbers (this is very silly and simple \"benchmark\"): - with hmin cpu was\nabout **60ms** (min) - with htmlmin cpu was about **1200ms** (min)\n\nMinus overhead, plain time: hmin - **20ms**, htmlmin - **1160ms**.\n\nProbably, you can get other numbers. But hmin really faster than\nhtmlmin.\n\nStupid speed benchmark (2)\n==========================\n\nAlso i try to compress 2mb of html on my desktop i3 (sandy bridge).\n\nDebug toolbar time: - with hmin cpu was about **220ms** without cache,\nand **87ms** with cache - with htmlmin cpu was about **125000ms**\n\nDjango overhead was about **80ms**. Minus overhead, plain time: hmin -\n**140ms** (**7ms** with cache), htmlmin - ok.\n\nCurrent problems\n================\n\n- Doesnt respect CDATA\n\nLicense\n=======\n\nWho cares? Use it whatever you want.\n\n.. |Build Status| image:: https://travis-ci.org/xfenix/django-hmin.svg?branch=master\n :target: https://travis-ci.org/xfenix/django-hmin\n", "description_content_type": null, "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/xfenix/django-hmin", "keywords": "", "license": "", "maintainer": "", "maintainer_email": "", "name": "django-hmin", "package_url": "https://pypi.org/project/django-hmin/", "platform": "", "project_url": "https://pypi.org/project/django-hmin/", "project_urls": { "Homepage": "https://github.com/xfenix/django-hmin" }, "release_url": "https://pypi.org/project/django-hmin/0.3.3/", "requires_dist": null, "requires_python": "", "summary": "Fast HTML minification function, django middleware, decorator", "version": "0.3.3" }, "last_serial": 2535333, "releases": { "0.1": [ { "comment_text": "", "digests": { "md5": "115080c3f00107bc91d2731eab4d0b6b", "sha256": "440a9d1b96fb12e80dfb7648b46bccf6df72b86bcfc79ceff51343f48d400562" }, "downloads": -1, "filename": "django-hmin-0.1.tar.gz", "has_sig": false, "md5_digest": "115080c3f00107bc91d2731eab4d0b6b", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 2209, "upload_time": "2014-10-20T15:40:22", "url": "https://files.pythonhosted.org/packages/6e/14/985c3ccb518d1e8b6e896ca0ef18506e56acf5991005b28d4ed544ab993f/django-hmin-0.1.tar.gz" } ], "0.2": [ { "comment_text": "", "digests": { "md5": "5bfc37439adbfd67745935a37a200c9f", "sha256": "399ede85aa7581bde516bc352a2c712acba5e29ad9af63c45d8bd9cb59a3de9e" }, "downloads": -1, "filename": "django-hmin-0.2.tar.gz", "has_sig": false, "md5_digest": "5bfc37439adbfd67745935a37a200c9f", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 2136, "upload_time": "2014-11-30T22:27:57", "url": "https://files.pythonhosted.org/packages/e8/db/fc77861200bc46505d763afa224279140c8def5d8bcacf524aa82e95abbd/django-hmin-0.2.tar.gz" } ], "0.2.1": [ { "comment_text": "", "digests": { "md5": "9f6d0823400df35c7fc7e09253c9b926", "sha256": "add478fb78e2187a89f603bc14aa71f52d7f45ada0b1f58061659fd9b42a16cc" }, "downloads": -1, "filename": "django-hmin-0.2.1.tar.gz", "has_sig": false, "md5_digest": "9f6d0823400df35c7fc7e09253c9b926", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 2139, "upload_time": "2014-11-30T22:34:11", "url": "https://files.pythonhosted.org/packages/f4/6e/94217489b01cdb488fd365f9f99f1b05990e4ada8b8c1c797eaa41841fb9/django-hmin-0.2.1.tar.gz" } ], "0.2.2": [ { "comment_text": "", "digests": { "md5": "a2df0677dea62b96e329db5cb8c6198c", "sha256": "8c56489837ac0a0affad5e9cead25b506c6d3bf13381cab2a935b4e603914569" }, "downloads": -1, "filename": "django-hmin-0.2.2.tar.gz", "has_sig": false, "md5_digest": "a2df0677dea62b96e329db5cb8c6198c", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3404, "upload_time": "2014-12-01T22:01:39", "url": "https://files.pythonhosted.org/packages/a9/91/9919ff69a8b665ef285dcf80a0efd3f993facbad390bcba144415f25f302/django-hmin-0.2.2.tar.gz" } ], "0.2.3": [ { "comment_text": "", "digests": { "md5": "e3cc2a81c4b0a0ae2fb3ec1b161c8b7d", "sha256": "442a611f51048a62cbcf99d3efcfe35f5130b4da9206ba1dea31ade5879997c5" }, "downloads": -1, "filename": "django-hmin-0.2.3.tar.gz", "has_sig": false, "md5_digest": "e3cc2a81c4b0a0ae2fb3ec1b161c8b7d", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3374, "upload_time": "2014-12-01T22:21:03", "url": "https://files.pythonhosted.org/packages/62/45/a340d64f624671174af437dabeab4995dfa3af1a897623711645798e1b10/django-hmin-0.2.3.tar.gz" } ], "0.2.4": [ { "comment_text": "", "digests": { "md5": "775a5ed334f4f1d94c28cea0dd4a8ac3", "sha256": "b2363d12f3a0ac38f5084c7f72715b36a5dd8f1df7d77f08a3302c689e9f825f" }, "downloads": -1, "filename": "django-hmin-0.2.4.tar.gz", "has_sig": false, "md5_digest": "775a5ed334f4f1d94c28cea0dd4a8ac3", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3382, "upload_time": "2014-12-01T23:21:15", "url": "https://files.pythonhosted.org/packages/f5/dc/ec00279e12e392c62968aa9b67d94f5ba0ccd99a9dae6f438252ee2a9bb5/django-hmin-0.2.4.tar.gz" } ], "0.3": [ { "comment_text": "", "digests": { "md5": "520d0b35fc3bc45aac6e527d3ba293c1", "sha256": "ddcaa1c80948a0f2f4858a521dc53a75e8e27f5a702c7c37f2e1834055c377d0" }, "downloads": -1, "filename": "django-hmin-0.3.tar.gz", "has_sig": false, "md5_digest": "520d0b35fc3bc45aac6e527d3ba293c1", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4570, "upload_time": "2014-12-09T17:50:27", "url": "https://files.pythonhosted.org/packages/73/e4/18d55b9210c01f092d4273de6975ea78dc1f5efd21d9e9bd0d01bb255682/django-hmin-0.3.tar.gz" } ], "0.3.1": [ { "comment_text": "", "digests": { "md5": "d5ce9bb747baada1e56dabbf1c31322d", "sha256": "7fb8ab49a93d72ac0819c07a220989ca921a0d71031e65f464bdbb7fcdda11d0" }, "downloads": -1, "filename": "django-hmin-0.3.1.tar.gz", "has_sig": false, "md5_digest": "d5ce9bb747baada1e56dabbf1c31322d", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4631, "upload_time": "2014-12-09T17:52:27", "url": "https://files.pythonhosted.org/packages/6b/44/ecf4364942c30180aeed3435d2fcd608291d64b25e304b5ab6f4d8947d4e/django-hmin-0.3.1.tar.gz" } ], "0.3.2": [ { "comment_text": "", "digests": { "md5": "0a872d007ab631d50cd70b39c4f62c85", "sha256": "3c56b4f62152ec9e918c4355731881848d4c01edf4d4a13799bcfd6d942ffad9" }, "downloads": -1, "filename": "django-hmin-0.3.2.tar.gz", "has_sig": false, "md5_digest": "0a872d007ab631d50cd70b39c4f62c85", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4657, "upload_time": "2014-12-09T18:12:45", "url": "https://files.pythonhosted.org/packages/52/61/58747e6c4880dbedc2a35bfded962dd402700093c3a75e32c8cd1d0f1948/django-hmin-0.3.2.tar.gz" } ], "0.3.3": [ { "comment_text": "", "digests": { "md5": "655ac4bc482c2e2770f4a5651f43cdbf", "sha256": "49be1cb3716caae2acefa6928104638ed7222e3e3280cbf6b820bd9b11eebd20" }, "downloads": -1, "filename": "django_hmin-0.3.3-py2-none-any.whl", "has_sig": false, "md5_digest": "655ac4bc482c2e2770f4a5651f43cdbf", "packagetype": "bdist_wheel", "python_version": "2.7", "requires_python": null, "size": 8671, "upload_time": "2016-12-22T18:02:13", "url": "https://files.pythonhosted.org/packages/c9/0c/a9f0928afb803182e291a5cd4db166e22cb6b7b9d170f3602dfe02b9d703/django_hmin-0.3.3-py2-none-any.whl" }, { "comment_text": "", "digests": { "md5": "750aab7a8de92becfb707920374eb020", "sha256": "9df3fc5f6d38f7dc51b7ee76d1daff2bc6c1a1b7050571b47cb9b52238eda745" }, "downloads": -1, "filename": "django-hmin-0.3.3.tar.gz", "has_sig": false, "md5_digest": "750aab7a8de92becfb707920374eb020", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4831, "upload_time": "2016-12-22T18:02:09", "url": "https://files.pythonhosted.org/packages/5f/9e/8c6c8060e5b62221bd5539878a4eae6e12ff978a6844995bea7be0524b63/django-hmin-0.3.3.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "655ac4bc482c2e2770f4a5651f43cdbf", "sha256": "49be1cb3716caae2acefa6928104638ed7222e3e3280cbf6b820bd9b11eebd20" }, "downloads": -1, "filename": "django_hmin-0.3.3-py2-none-any.whl", "has_sig": false, "md5_digest": "655ac4bc482c2e2770f4a5651f43cdbf", "packagetype": "bdist_wheel", "python_version": "2.7", "requires_python": null, "size": 8671, "upload_time": "2016-12-22T18:02:13", "url": "https://files.pythonhosted.org/packages/c9/0c/a9f0928afb803182e291a5cd4db166e22cb6b7b9d170f3602dfe02b9d703/django_hmin-0.3.3-py2-none-any.whl" }, { "comment_text": "", "digests": { "md5": "750aab7a8de92becfb707920374eb020", "sha256": "9df3fc5f6d38f7dc51b7ee76d1daff2bc6c1a1b7050571b47cb9b52238eda745" }, "downloads": -1, "filename": "django-hmin-0.3.3.tar.gz", "has_sig": false, "md5_digest": "750aab7a8de92becfb707920374eb020", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4831, "upload_time": "2016-12-22T18:02:09", "url": "https://files.pythonhosted.org/packages/5f/9e/8c6c8060e5b62221bd5539878a4eae6e12ff978a6844995bea7be0524b63/django-hmin-0.3.3.tar.gz" } ] }