Topics

User Functions

Events

There are no upcoming events

What's New

Stories

No new stories

Comments last 2 weeks

No new comments

Trackbacks last 2 weeks

No new trackback comments

Links last 2 weeks

No recent new links

NEW FILES last 14 days

No new files

Welcome to Geeklog Monday, May 20 2013 @ 04:29 PM EDT

> >

Other Improvements in Geeklog 1.6.0

Geeklog
  • Monday, June 22 2009 @ 01:50 PM EDT
  • Contributed by:
  • Views:
    4,902

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.

Canonical URLs

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".

Output Compression

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.

Trackback

Trackback URL for this entry:
http://www.geeklog.net/trackback.php/geeklog-1.6.0-other-new-features

[...] 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.

  • Other Improvements in Geeklog 1.6.0
  • Authored by:LWC on Monday, June 22 2009 @ 02:30 PM EDT
Is there something the site's log should reflect after enabling compression? I mean, how does one know if it had any effect? Some comments concerning plugin authors:
  1. Is there an API for canonical links? I just did this.
  2. COM_output is not backward compatible. So be sure to use this.
  3. Would you advise adapting to using COM_output for everything (including admin stuff) or just for non admin content?
Thanks!
  • Other Improvements in Geeklog 1.6.0
  • Authored by:Dirk on Tuesday, June 23 2009 @ 03:35 AM EDT

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.

  • Other Improvements in Geeklog 1.6.0
  • Authored by:LWC on Thursday, June 25 2009 @ 10:07 AM EDT
What about PHP staticpages that have use echo?
  • Other Improvements in Geeklog 1.6.0
  • Authored by:Dirk on Saturday, June 27 2009 @ 02:35 PM EDT

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.

  • Other Improvements in Geeklog 1.6.0
  • Authored by:LWC on Saturday, June 27 2009 @ 05:08 PM EDT
So I take it PHP staticpages needn't (and shouldn't) use the new function. It's only meant for plugins.
  • Other Improvements in Geeklog 1.6.0
  • Authored by:LWC on Saturday, June 27 2009 @ 05:08 PM EDT
Plugins and PHP blocks, that is.
  • Other Improvements in Geeklog 1.6.0
  • Authored by:Dirk on Saturday, June 27 2009 @ 05:18 PM EDT

You shouldn't use it in the PHP code in a static page, yes.

Post a Comment

Your Name
Create Account
Allowed HTML Tags:
 

Security code
This question is for testing whether you are a human visitor and to prevent automated spam submissions.

What code is in the image?
Enter the bolded text, case sensitive!
Important Stuff
  • Please try to keep posts on topic.
  • Try to reply to other people comments instead of starting new threads.
  • Read other people's messages before posting your own to avoid simply duplicating what has already been said.
  • Use a clear subject that describes what your message is about.
  • Your email address will NOT be made public.