Re:Zotonic...rethinks the CMS with Erlang
by Wok on Wednesday July 21, 2010 @02:01PM
(#1535942)
The most important things we changed are:
- Pluggable dispatcher, as the original webmachine copies all dispatch rules for every request. This gave us the greatest speedup as a Zotonic server typically has hundreds of dispatch rules.
- Removal of all process dictionary use. This makes testing easier and also gave a nice speedup.
- Use proplists instead of dicts for small dictionaries.
- Use a memocache for the resource callback functions.
- Removed the use of parametrized modules, this enables us to copy less data (and gives simpler code).
- Added support for protocol upgrades (for Websockets)
Our dispatcher also accepts regular expression checking on uri parameters. And it uses a different approach to vhost handling, allowing a redirect to the main hostname (which is needed when you set browser cookies).
- Pluggable dispatcher, as the original webmachine copies all dispatch rules for every request. This gave us the greatest speedup as a Zotonic server typically has hundreds of dispatch rules.
- Removal of all process dictionary use. This makes testing easier and also gave a nice speedup.
- Use proplists instead of dicts for small dictionaries.
- Use a memocache for the resource callback functions.
- Removed the use of parametrized modules, this enables us to copy less data (and gives simpler code).
- Added support for protocol upgrades (for Websockets)
Our dispatcher also accepts regular expression checking on uri parameters. And it uses a different approach to vhost handling, allowing a redirect to the main hostname (which is needed when you set browser cookies).