Preloading posts is one of the popular recommendations by most articles on the internet on how to speed up your WordPress site. Since, most WordPress sites (I’d say over 99%) have little or negligible traffic, it is highly recommended to get the posts preloaded in the cache so that the visitors do not have to wait to get the generated on-the-fly that actually takes some time. In this case, by the time the post is generated to be served to the visitor, the visitors may have gone to visit another website. So, do I recommend preloading? Yes (for low traffic sites) and no (for high traffic sites). Read more for a bit of explanation on this…
Caching ecosystem around WordPress grows constantly with newer caching plugins coming up every year. In order to arrive at the best solution for caching, one needs to understand how everything fits together in a cache. There are multiple caching layers available. When a user sends a request to a particular page in a domain, for example home page of this domain, the reply doesn’t come fresh from the site. If it needs fresh data, it has to be prepared from scratch by this site. That in turn would take a lot of time to prepare and then send it to the user’s browser. The visitors would have closed the website and would have turned to another site, if the request doesn’t arrive within a second (in most cases). In order to achieve this 1-second milestone, the sites incorporate different caching layers to serve the request. Continue reading “Full Page Caching Options for WP Blogs”
Web server market is dominated by Apache HTTP server that enjoys its status because of its open source nature and because of its role in bringing the masses to the world wide web. Without it, we may not have had so many web hosts and web sites. However, its memory footprint has been a concern until today.
Nginx is the second largest in terms of Web Servers Market Share. While Nginx is still open source, the constant upselling of its commercial subscription may not be welcomed by everyone. Don’t get me wrong. I use Nginx too for its low memory footprint and its efficiency in serving static files.
Microsoft’s IIS is third most popular web server. It is rock solid, having its own use cases.
OpenLiteSpeed is very limited in its functionality.
Traditionally, web sites use either www or non-www version to display their content to the visitors. Sub-domains are also becoming popular in recent times. When www is chosen as the preferred domain when installing WordPress (or after installing WordPress), whenever a visitor types non-www version of the site, WordPress redirects the visitor to the correct URL, the www version the site, through an internal 301 redirect. Google recommends this 301 redirect and Google WebMaster Tools has an option to set the preferred domain too. Continue reading “Efficient 301 Redirects”
Recently, in one of my clients’ server, we decided to move to the traditional Apache with mod_php instead of Nginx with php-fpm, after going through the pros and cons of each setup. If you are not aware already that
AllowOverride All brings a major performance lag into the whole setup. To overcome this, we can move the rewrite rules written on any part of your site into Apache’s configuration file (apache.conf or httpd.conf or any other name depending on the distribution you use). By moving the rewrite rules into the httpd.conf, we could disable AllowOverride altogether for a particular site and make this Apache with mod_php server stack a bit faster than Nginx with php-fpm stack. Here is how you can move all the rewrite rules into your server’s config… Continue reading “Moving WP .htaccess rules to httpd.conf”
Note (as of August 30, 2017): The original post was published for Varnish 3. A lot changed since then. Currently, we have a nicer way to achieve 301 redirects. Thanks!
Varnish is a powerful caching HTTP reverse proxy server. It can sit in front of Apache or Nginx and can cache the requests that are configured to be cached. Varnish offers a lot of flexibility on what to cache and what not to cache. However, it doesn’t offer any simple redirection by default. When it stands in front of a general purpose web server, it sends the requests to the backend (in our case, Nginx), and then sends the backend response to the browser. While this is the natural process, there are a couple of ways to reduce this round-trip and save a bit of time. After all, every millisecond counts! Continue reading “Varnish 301 Redirect”
Google XML Sitemaps plugin for WordPress is probably one of the popular plugins in WordPress plugins repository. At the time of this writing, it has been downloaded over 8 million times! It is not a small feat by any means. However, if it is used incorrectly, it can drag your site’s performance considerably. Some web hosts even alert the site owner, if this plugin is used in their sites and politely ask the site owner to remove it at the earliest. So, what’s wrong with this plugin and how can you make use of it without affecting your site’s performance (and your host’s CPU). Let’s dive in!