May 152014

Sometimes, the structure of the content of a web site need to be modified, causing the URLs used to access some of the pages in the site to be changed.

But other web sites might already have created links to our site, using the old URLs. Besides, some users might have bookmarked the old URLs in their browsers. Finally, search engines such as Google or Bing might already have indexed the content of our site using the old URLs.

To prevent all those valuable references to become broken links, we can program the site to redirect users, as well as search engines, to the new URLs, when requests for the old URLs are received.

Continue reading »

 Posted by at 5:34 pm
Apr 042014

Many web sites offer dynamic content that results from the execution of a script, in many cases written in PHP. Every time the web server receives a request, the script that generates the HTML code returned to the client runs,often performing several database queries, or any other type of processing that might be expensive in time and resource usage, resulting in a slow response time and poor user experience.

This post explains the implementation of a cache mechanism that may alleviate this problem: The HTML code resulting from the execution of the script is saved to disk, and every time a new request is received for the same page, this pre-processed content is served directly from the disk cache, thus avoiding the need to execute again the whole process.

Continue reading »

 Posted by at 12:01 pm
Dec 112013

The base functionality of the WordPress CMS (Content Management System) can be expanded developing themes and plugins that get “hooked” at different points of the process performed by WordPress to serve incoming requests.

The functionality of a given plugin may require adding tables to the database, or performing queries to the existing tables, in a non-standard way that cannot be carried out with the functions available in the base WordPress distribution.

WordPress provides a “wpdb” class that can be used to execute any kind of query against the database, to retrieve or modify data stored in it.

This post explains how to work with the $wpdb object.

Continue reading »

 Posted by at 4:08 pm