When size does matter: shrink your XML
During the last weeks we’ve fixed bugs, added and removed features, tweaked the UI and Jan worked on the design. In short: a lot of work!
Since we are following the rules of optimisation we did not tackle performance so far. After benchmarking we decided that it is time to shrink the size of the XML we send back and forth between client and server. Here are the steps we followed:
- Remove unused content. Easy, I know. But for some models we still relied on the default to_xml() method which includes about every attribute. Use the :only or :exclude options to remove unused elements.
- Flatten hierarchy. Remove unused nested elements.
- Move child elements to attributes. This works as long as the child elements do not represent complex/nested data
- Shorten names of elements and attributes.
- And, of course, we added mod_deflate to our Apache
That’s it. Following these simple steps significantly reduced the amount of transferred data, server load was decreased and - most important - the client responds faster to user interaction.
About this entry
You’re currently reading “When size does matter: shrink your XML,” an entry on viibee.com
- Published:
- 11.26.07 / 12pm
- Category:
- tech talk

No comments
Jump to comment form | comments rss [?] | trackback uri [?]