Home > SQL

After upgrading to Drupal 6 I opted for a quick and dirty XML sitemap approach. Before I was using the XML Sitemap module which is currently available for Drupal 6 as a development snapshot or directly from CVS. The module offers settings for priority and change frequency. Moreover the module allows for adding taxonomy term and user URLs to the sitemap.

I only wanted nodes and the front page to appear in the sitemap's XML output without priority or change frequency information. Having the path and pathauto modules enabled, which ensure that every node gets a meaningful and search engine friendly URL, a simple database query joining two tables is enough to get the necessary data for all published nodes.

pMetrics

pMetrics (performancing Metrics) is a feature rich advanced Web statistics and visitor tracking solution offered by Performancing, Inc. The pMetrics module for Drupal lets you integrate this service easily in your Drupal site, provided you have signed up for pMetrics.

Recently I wrote an article where I explained how to clear page cache entries in Drupal when content is commented on. This time I want to clear entries in the cache_page database table when the following conditions apply:

  1. A new node is created, set to published and promoted to the front page.
  2. A published node which is promoted to the front page is deleted.
  3. A published node which is promoted to the front page is unpublished.
  4. A node which is promoted to the front page is unpublished.
  5. A published node is updated.

Using Drupal's cache can greatly reduce server load, especially if you have lots of non-logged in visitors and many database queries have to executed before a page is displayed. When caching is turned on the HTML output of a page is stored in the cache_page table, so one query is enough to retrieve the HTML output for display instead of hundreds of queries on pages with many blocks, links, etc.

For logged in users pages are not retrieved from the cache but are newly generated each time they request a page. If logged in users post a comment for example they see it immediately after they hit the submit button, wheres non-logged users have to wait until the minimum cache lifetime of the page has expired.

The Drupal core comment module comes with a block called Recent Comments, that displays links to the latest comments, the comment author's name and the time that passed since the comment was posted.

If you configure the comment module so that users can enter their homepage URL the comment author's name displayed in the comment block is not a link to the URL entered.

Considering the huge amount of spam comments blogs receive this seems perfectly reasonably. But you can configure Drupal so that comments by anonymous user's must be approved. This way you can prevent spam comments from being displayed publicly.

Syndicate content