Sign up for our newsletter or RSS feed to receive updates automatically blog!

Improving the performance of WordPress: checking the answers 404



WordPress, in its simplicity of use, is actually a software with complex mechanisms that have done the Platform for blogging most successful in the world.

These mechanisms, however, may give rise to problems of overloading of servers in pointless trivial cases, such as lack of an image, a javascript or a request that produces as a response HTTP error "404 Not Found."

To understand why we must first have a clear mechanism of "demand-response" in WordPress and configurations which can trigger this degradation.

The conditions are those of 'use of permalinks (configured in the options panel / permalink) exploiting some features of Apache to have links purely textual and without parameters.

When a browser "calls" a page through a permalink (either the home page with a list of articles, is a specific article or anything else), the Apache Web server is instructed to postpone the request WordPress, who will take care to identify the contents and build the page. If the request concerns but a resource that exists in their own web space (such as an image), Apache is instructed to upload it and send it to intervene without WordPress.

This efficient system has a flaw that emerges when a resource is required but is not present in the web space. Apache is not finding, leads to the answer WordPress. Obviously for WordPress is a "senseless" and builds the page 404, or the page which says that the user has not been found as required.

The construction of this page is heavy: it involves the activation of WordPress, opening connections to the database, the activation of all plugin, the search of that will not be found. The page also will probably contain a list of categories, the list of recent articles and so on.

What was reflected in the simple answer "not found", becomes a series of transactions so complex and heavy as those for the construction of a normal page. So the vision of an article "causes" of requests for resources that do not exist, for each of these requests are active WordPress impegando the web server and database unnecessarily.

How to verify this? Without making any changes to your blog, simply use Firefox with a plug-specific: Live Http Header. Once installed and restarted Firefox, is activated by selecting the appropriate item on the Tools menu.

It will have a window that will display since then all requests Firefox. Just at this point open the homepage of his blog to find any answers 404. Those responses show what resources are missing and therefore must be corrected.

A classic example is due to free WordPress themes. To make it customizable themes can be modified change a background image, typically the head of the blog. This image is sometimes not included with the theme, but is nevertheless included a reference in the style sheet (the file usually called "style.css").

The browser that analyzes the style sheet obviously trying to upload the image that produces a 404. None of it because the layout is designed to be corrected even in the absence of the image, but meanwhile our database is working all'impazzata.

A real example is shown in the picture where the image specified in the style sheet is not present (it is a true made on a blog exists).

Firefox plugin live http headers

Other cases are less obvious due to files that are usually optional on a site like favicon.ico and robots.txt.

The first is prompted by the browser, usually with "criteria", and if not found does not insist and do not load the server. But if your blog is listed in some collections of sites, the request of favicon.ico may be so insistent on the basis of the volume of traffic that makes the list regardless of the views of our blog.

The request from the robots.txt file is made by bot search engine. Unfortunately, some of them are quite aggressive in demanding that the files are not present even several times a day, creating a cargo absolutely useless.

The problem is resolved by including the two files to your blog. And now I leave you to your blog with the tools you can find below.

Install Firefox and then download the plugin Live Http Header or see the profile.



Did you like this article? Sign up now to receive updates or news articles:
Subscribe to RSS feeds write to the RSS feed


Still no comment '

Follow any comments on this post via RSS feed.
You can leave a comment, or use the TrackBack URI directly from your site.

leave a comment

XHTML: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>


Nothing2Hide © 2006 All rights reserved.

License | Disclaimer

Close
Send e-mail