Django

Code

Ticket #2805 (closed: fixed)

Opened 2 years ago

Last modified 2 years ago

[patch] make sitemaps more space effective

Reported by: Maximillian dornseif <md@hudora.de> Assigned to: adrian
Milestone: Component: Contrib apps
Version: 0.95 Keywords:
Cc: Triage Stage: Unreviewed
Has patch: 1 Needs documentation: 0
Needs tests: 0 Patch needs improvement: 0

Description

The XML generates by sitemaps contains lot of whitespace. Since sitemaps are meant to be only processed by machines and the templates are only seldom edited by humans it makes sense to strip out most unneeded whitespace. Basically this is a readability bandwidth tradeoff. This patch changes the sitemaps framework to use the same approach as the syndication framework: prefer bandwidth over readability. It reduced the size of my sitemap by about 20 %.

Get the Patch at http://c0re.23.nu/c0de/misc/django-3810-sitemap_space_saver.diff

Attachments

django-3810-sitemap_space_saver.diff.txt (1.6 kB) - added by md@hudora.de on 09/23/06 15:50:21.

Change History

09/23/06 15:50:21 changed by md@hudora.de

  • attachment django-3810-sitemap_space_saver.diff.txt added.

09/26/06 11:26:48 changed by adrian

Readability of XML is not important, but readability of templates *is* important. A good solution could be to use the {% spaceless %} template tag to strip the space on output. I'll check in that change momentarily.

Also note that if you're super concerned about bandwidth, just use gzip for your sitemap. See the djangoproject.com URLconf for an example of how to do that.

09/26/06 11:27:25 changed by adrian

  • status changed from new to closed.
  • resolution set to fixed.

(In [3869]) Fixed #2805 -- Removed some whitespace from the two sitemap XML templates.


Add/Change #2805 ([patch] make sitemaps more space effective)




Change Properties
Action