YesNoOk
avatar

Changelogs week 42, 2011 (Read 1799 times)

Started by Nightwish, October 17, 2011, 23:02:25

0 Members and 1 Guest are viewing this.
#1
Changelogs week 42, 2011 |
October 17, 2011, 23:02:25
A new approach to SEF URLs

Doing some benchmarks, I found pretty devastating results for the performance of the output buffer rewrite that is needed to rewrite all URLs into a nice looking (or so-called "SEO friendly") format. The time it needs obviously depends on 2 factors:
  • Number of URLs to rewrite
  • The size of the buffer
It was acceptable for smaller pages (like the board index), but totally disappointing for larger pages, especially long topic views. Up to 130ms for the rewriting of more than 300 URLs in the buffer is totally insane when the actual page generation took only about 30ms. That could easily kill a large board under heavy load...

Reducing the number of URLs to rewrite will obviously help and we don't really need pretty URLs for everything. All the links that search engines will never see (like the buttons for posting, quoting, replying or links that only appear for registered users) can be left in the standard URL format. Furthermore, creating the links already in their prettified form helps again and is a good opportunity to clean up the messy and repetitive URL generation throughout the code, replacing it with common functions that can generate URLs for topics, profiles, boards and other things.Such URLs are already in the pretty format and this will save a lot of time in the buffer rewriting process.

Commit ID: cb5bded4e15c15750854806285eb790fbe6c8920, 22 changed files with 380 additions and 318 deletions.
Commit ID: aaf1b40a384eb00933891f6e92e354a52afc8324, 11 changed files with 157 additions and 52 deletions.
  • Fixed a serious issue with SEF URLs leading to noindex tags on topic and message index pages.
  • Improved UI for editing board news items.
  • Make SimpleSEF redirects from standard to prettyfied URLs optional
  • Implemented generic URL generators for topic, board and profile URLs
  • Only rewrite necessary URLs in the output buffer
With the new URL generation and lightweight buffer rewriting that only looks at a few URLs that could not be generated during page build up (one example would be URLs from BBCodes) the performance impact for SEO URls is now minimal. On average, 5-10ms are spent on buffer rewriting for a long page and for most others, the numbers are much lower on my testing system (the actual numbers appear in the bottom right corner of every page). I think, that's acceptable. It should be clear that pretty URLs will always come with a price tag attached, but it doesn't have to be a hefty one.
__
Every program has at least one bug and can be shortened by at least one instruction -- from which, by induction, one can deduce that every program can be reduced to a single instruction that doesn't work.
My SMF-based forum fork
Last Edit: October 18, 2011, 14:06:04 by Nightwish
#2
Re: Changelogs week 42, 2011 |
October 19, 2011, 15:26:47
Commit ID: 9f7798a80416a3d8ef55811e7ae676672c1e2711, 33 changed files with 436 additions and 446 deletions.
  • The base URI component for topics can now be customized.
  • Moved URLFactory code to SimpleSEF.php (they are related)
  • URL methods now use SimpleSEF settings
  • Moved smcFunc[] compatibility code to its own file (Compat.php) - considering whether we should also add the SMF 2 - compatible hooks API
  • More modules are now using the URLFactory methods for creating SEF URLs.
  • allow moderators to lock a message to prevent users from reverting moderator edits. Locked messages can no longer be edited except by moderators or admins.
Last Edit: October 19, 2011, 15:28:32 by Velvet
#3
Re: Changelogs week 42, 2011 |
October 21, 2011, 11:04:12
Commit ID: e36d4bdbe1817d891c0d0aa80141f1a4788035ae, 15 changed files with 560 additions and 419 deletions.
  • Continuing using URLFactory to create topic, member and board URLs.
  • Optimized a few queries for the activity stream.
  • Implemented a generic and more compact postbit template for recent/profile/search message display.
  • Converted recent post display to the generic postbit template. Other post display areas (profile, search results) will follow.
  • Profile -> Show Posts -> Topics now really shows the topics in a message-index style.
  • Profile -> Show Posts -> Posts now using the generic postbit.

     Posted: October 23, 2011, 14:27:39
Focus still lies on URL generation to get rid of most buffer rewrites for creating SEF URLs. A few other minor changes here and there...

Commit ID: 7dca993618ffc939b7cf5b9a59d1005ab227bddf, 23 changed files with 300 additions and 241 deletions.
Commit ID: ccdf3a06caecf0c98473caddf4f2f7f568c0089c, 8 changed files with 35 additions and 53 deletions.
  • A couple of styling changes / corrections for the new profile "show posts" area layout.
  • parse error messages in ajax response documents and display them with a modal JS dialog.
  • Implement JavaScript alert_() with custom modal dialog.
  • sa=getlikes converted to xml output.
  • generic helper to parse conventional URLs into SEF URLs for all cases for which we don't have the faster URL crafting methods.
  • message rendering now depends on the postbit callback defined by prepareDisplayContext(). This allows for even more flexibility in the topic layout.
  • allow unapproving of messages - this can be used to simulate the soft-delete feature like it is offered by other forum products.
__
Every program has at least one bug and can be shortened by at least one instruction -- from which, by induction, one can deduce that every program can be reduced to a single instruction that doesn't work.
My SMF-based forum fork