My Complains... ;-)
In an other discussion there is the question which complains Vanilla users have and what we think of the Vanilla roadmap.
Because it doesn't really fit there, but it's teasing my brain for some time already, I decided to simply write it down in a new discussion. So here are my complains!
Format = "WYSIWYG"
How should "WYSIWYG" be a format?! (and I'm really tempted to write this all uppercase and use at least a dozen exclamation/question marks)
The new editor made that necessary in some way. I have to admit that I took no deeper look in why that should be necessary because everytime I thought about it, I just felt too reluctant and tried to stop thinking about it as soon as possible...
By now the format of a discussion/comment has been "HTML", "BBCcode" or "Markdown" - all of them being a format. But "WYSIWYG"?
I simply hate to see "WYSIWYG" in a column called "Format". And those changes were even made in the core although the editor is just a plugin.
Don't serve pre-rendered body
Maybe I'm completely on the wrong track. But to my understanding a discussion/comment body has to be rendered everytime a user accesses a discussion. The database serves the unformatted text, so no db cache can help and the page a user looks at looks different for every user, so no html cache can help. So if 100 users open a discussion it will be formatted 100 times. That's annoying me!
I know it would be space consuming, but wouldn't it be much faster if there would be a pre-rendered copy of each posting? And is speed for the sake of db space not to be preferred? I'm really not sure about this two assumptions, but it feels correct to me - I'm talking about complains, so I think it is okay to argue with feelings
Imagine there would be 'IsFormatter' => true; 'DateEnabled' => 'YYYY-MM-DD';
possible in $PluginInfo. And the model that gets the body of a post wouldn't render the original body, but instead check a db field of that post called 'DateLastRendered'.
If any plugin with IsFormatter = true and DateEnabled >= DateLastRendered exists (perhaps also take time into consideration and not only date), the body would be send to all needed formatters and the rendered result would be saved in the db and served to the user. After that, all other users would just see the prerendered version. Wouldn't that be an enormous speed gain? All those smileys, text formatting, etc. only done once and not again and again and again....
Well, that's it already and that is the good point: only two complains!
Comments
Regarding your second point, check out this secret plugin of mine, which does what you describe: https://github.com/bleistivt/Prerender/blob/master/class.prerender.plugin.php
The speed gain is not noticeable unless your posts contain a lot of formatting. I tested it with markdown pasting the original spec into multiple postings.
Overall it would probably decrease the server load, but there is also the option to use an HTTP accelerator like varnish to serve prerendered pages to guest users which should be your first option if you have to handle heavy traffic.
Obviously, a plugin that hooks into FormatBody is not the ideal way to do this, so there might be a bigger gain if this is in the core.
My themes: pure | minusbaseline - My plugins: CSSedit | HTMLedit | InfiniteScroll | BirthdayModule | [all] - PM me about customizations
VanillaSkins.com - Plugins, Themes and Graphics for Vanillaforums OS
Awesome! I'm happy I'm not the only one thinking about such things