Welcome to Geeklog Monday, May 20 2013 @ 04:29 PM EDT
Geeklog 1.6.0 brings quite a few obvious improvements (new search, comment improvements, migration support, plugin uploads, XMLSitemap plugin), but also some minor useful changes.
With this article, I'd like to point out two such new features: Support for canonical URLs and output compression.
Consider the following URLs:
http://www.geeklog.net/article.php/geeklog-1.6.0-other-new-features http://www.geeklog.net/article.php?story=geeklog-1.6.0-other-new-features http://www.geeklog.net/article.php/geeklog-1.6.0-other-new-features/print http://www.geeklog.net/article.php?story=geeklog-1.6.0-other-new-features&mode=print http://www.geeklog.net/article.php/geeklog-1.6.0-other-new-features?query=canonical
All of these will take you to a page that effectively contains the same content (this article). These URLs represent duplicate content on a site and that's a bad thing for several reasons: For one, different people may use different URLs when linking to your content and the page rank that you will gain through the linkage will be split up between these different URLs. There's also the risk of being penalized for having too many forms of duplicated content on your site. With the "query" parameter, there is an infinitive amount of possible URLs that would all produce pretty much the same content.
What can be done about this? Geeklog already adds a rel="nofollow" to the links pointing to the printable version of articles and static pages. You could also use a robots.txt or some clever URL redirects to further minimize the damage. But all those would have to be done outside of Geeklog and require additional work for each new article you publish.
Fortunately, the big search engines agreed on a new and much simpler measure: A new meta tag that indicates the so-called canonical URL for a page. When you view the HTML source code for this article, you'll find this line in the <head> section:
<link rel="canonical" href="http://www.geeklog.net/article.php/geeklog-1.6.0-other-new-features">
And you'll find the exact same entry for any of the different URLs for this article as listed above. So this entry tells a search engine that this is the preferred URL for this article and if it ends up here by using a different URL, it should treat it as if it had found it using this canonical URL. Problem solved.
Geeklog 1.6.0 supports canonical URLs in stories, static pages, and the article directory. There is nothing for you to configure - it works "out of the box".
The geeklog.net index page weighs in at about 50KB (give or take a few KB) of HTML. That is 50KB that is being pushed down the line of anyone calling up the Geeklog homepage. It adds to the monthly traffic that the site is causing (which we fortunately don't have to pay for, thanks to our hosting sponsor), it adds to the traffic that any visitor pays their ISP for, and it does of course take its time to get to the visitor's browser, especially if they're on a slow connection. It's not much, but it adds up.
Output compression can help here: Instead of sending the HTML "as is", Geeklog 1.6.0 can now optionally compress it before it's being sent down the line. With the 50KB compressed down to something like 8KB (typically), this can make a difference.
Output compression is disabled by default. To enable it, go to
Configuration > Geeklog > Miscellaneous > Miscellaneous
and set "Send compressed output?" to "True". Geeklog will then start sending compressed output to those browsers that support it.
While this feature should be considered experimental for now, it does seem to work quite well. If you can read this article, then it works, since output compression is enabled on geeklog.net. A potential downside of this option is that it requires slightly more CPU time on both the server and the client side. We haven't seen a significant increase in the CPU load on our server during the 3 weeks it has been in use here, though.
A note to authors of plugins and other add-ons: To use output compression in your plugin, you will need to call the new function COM_output instead of simply echo'ing the HTML. And you need to send the entire content of the page at once! The "Geeklog way" has always been to collect the output in a string variable and send it with a single echo at the end of the script. If your plugin works like that, you can simply replace the echo with COM_output and immediately enjoy the benefits of output compression.
Here's what others have to say about 'Other Improvements in Geeklog 1.6.0':
[...] 1.6.0rc2 FCKeditor 2.6.4.1... Links last 2 weeksNo recent new links Older Stories Monday 22-Jun Other Improvements in Geeklog 1.6.0 (7)Sunday 21-Jun Geeklog 1.6.0 BETA 3 (1)Monday 08-Jun Private Message Plugin and Groups Plugin (1)Thursday [...] [read more]
[...] AudioPlayer.setup("http://devnote.com.mx/wp-content/plugins/podcasting/player/player.swf", { width: 290 ~);Otras mejoras, como la URL canónica, el apoyo a la salida de compresión, y la protección contra secuestro de [...] [read more]
[...] AudioPlayer.setup("http://devnote.com.mx/wp-content/plugins/podcasting/player/player.swf", { width: 290 ~);Otras mejoras, como la URL canónica, el apoyo a la salida de compresión, y la protección contra secuestro de [...] [read more]
[...] lo que permite a los motores de búsqueda rastrear mejor el contenido de los sitios. Otros cambiosOtras mejorasesión, y la protección contra secuestro de clics ya se han discutido en otros lugares. Geeklog 1.6.0 [...] [read more]
[...] (por Mystral-kk) para generar automáticamente un fichero para mapa del sitio, en ficheros sitemap.xml.otros cambiose;n de salida (en mi opinión, solo recomendado en servidores con mucho poder de procesamiento), y [...] [read more]
The following comments are owned by whomever posted them. This site is not responsible for what they say.
- Is there an API for canonical links? I just did this.
- COM_output is not backward compatible. So be sure to use this.
- Would you advise adapting to using COM_output for everything (including admin stuff) or just for non admin content?
Thanks!The only way to see if compression is enabled is to check your webserver's logfile and compare the size of pages before/after the switch. Or maybe some of the add-ons for Firefox may be able to indicate that compression is being used. See if you can find something like Content-encoding: gzip in the webserver's response.
There is no API for canonical URLs. After all, it's only an additional entry for the site header, and we already have several ways to add to that.
I'd use COM_output for any non-trivial output. Some of the admin lists can get quite long, for example, so why not use it there, too? When going through the Geeklog code, I skipped a few places where it always echos out the return value from COM_refresh - that's only a short piece of HTML and probably not worth compressing.
You had me worried there for a moment ... It's not a problem, though. Geeklog already catches the echo output (via output buffering) and then does the output (together with the header, footer, etc.) all at once.
You shouldn't use it in the PHP code in a static page, yes.