Varnish and WordPress

Like the other day I commented something about Varnish and a new plugin and some of you already asked in the comments, I think It was already time for to explain what is Varnish a really powerful cache system, fantastic for WordPress installations with a lot of traffic, and that as you can imagine use here in WordPress Help .

Let's go then …

What is Varnish?

Varnish Cache is a web accelerator or an HTTP cache system of reverse proxy . It is installed on any server that serves (OK, it is redundant) HTTP and is configured to cache its contents . According to some studies accelerates the service by 70% .

Cachear a web, if someone does not know it yet, is to store a copy of it to be what they see future visitors. In the case of Varnish and WordPress, what you get is to serve cached (stored) pages of your WordPress so you do not have to make calls to the database every time someone visits your website. This reduces server load because it simply serves a single copy of the pages to all visitors without having to search for the same images and services for each content and each visitor.

Additionally, Varnish caches pages in memory virtual so that your site loads much faster, which incidentally improves your SEO, because Google has estimated that for every half second of additional load time of a website it receives an average of 20% fewer visitors ( source ). In this way, reducing with Varnish in an important way the page load time can increase your visits and improve your search engine ranking something always to be taken into account.

The people of Varnish have published a very simple video, while explanatory that surely illustrates what it does …

Installing Varnish

Varnish is a free software so you have no excuses to install it right now. It runs on Linux preferably on FreeBSD, but it can work equally on other platforms. Once you install it you can customize it to define how many incoming requests it will manage using the Varnish Configuration Language ( Varnish Configuration Language or VCL).

Varnish is designed so that be flexible so that you can install it thinking of a specific place in mind, and adapt it in a personalized way to it.

Ideally start with a basic configuration of Varnish for later go testing small changes and see how they affect the performance of the particular site. There are several subroutines that tell Varnish how to respond to incoming and outgoing requests, errors, etc.

So let's start with a basic configuration, and then take a look at the basic functions of the VCL and then you tune it to your liking.

Step by step

Starting Varnish is quite simple. Starting from a base of, say, Apache in a system Debian (most Linux servers), although it also works in the rest, we would start with this command:

First you have to configure Apache so that "Listen" to port 8080 of localhost. Varnish will then be able to listen to port 80 (where the visits come from). In file /etc/apache2/ports.conf edit these settings:

To start Varnish (by default it does not ), edit the following in the file / etc / default / varnish

Replace IP_EXTERNAL_DRIVE with the IP of your external IP address. It can also be an internal address if your server is after a load balancer or something like NGINX . This setting controls which IP address and port you want Varnish to listen to and watch.

Once the above is done, edit the file /etc/varnish/default.vcl which should already exist, with much of its Content commented (not active). We will start by changing the backend default .

Now Varnish already knows that Apache is listening to port 8080 and the localhost interface, so we can start using functions. Most of the work will be done with vcl_recv and vcl_fetch, and if you do not call an action in this subroutine and Varnish reaches the end, it will execute the code it finds in the file default.vcl.

Note: no caches ever wp_admin wp_login or similar routes.

This is how it works – the 4 basic subroutines of your Varnish configuration that you need to manage requests will be:

This call is made at the beginning of a request, and tells Varnish what to do with that particular request: if it has to serve it, how to serve it, and what backup to use.

Varnish receives a request from your browser, and then vcl_recv decides to make a 3 costs with it: vcl_hash, vcl_pass, and vcl_pipe ] (Now I explain). You can change the request if you want, alter the cookies or remove the header of the request.

A vcl_fetch is called after a document has been successfully retrieved. You use this to alter the response headers, launch the ESI processing, or to try to alternate between backup servers if the request fails.

The requested object, req is still available, and there is also a backup response, beresp which contains the HTTP headers of the backup.

You can call hash_data of the data you want to add to the hash. This subroutine can end with a call to return () with one of these keywords: hash or proceed .

You call this before the object cacheado is delivered to the client. This may end with deliver, error code, or restart. Deliver delivers the object to the client, error returns the specific error code to the client and abandons the request, restart will restart the transaction and increase the restart count.

Actions

There are certain actions you can perform on each subroutine when you customize Varnish:

Passes the request and its subsequent response to the backup server, without caching. You can call pass in both vcl_recv and in vcl_fetch.

The request is made from vcl_recv to deliver content from the cache although the petition indicates that it must be passed. You can call lookup from vcl_fetch.

From vcl_recv pipe short-circuits the client and backup connections, and Varnish simply it stays there passing the data to one side and another, recording the data, so the records will be incomplete. Be careful since an HTTP 1.1 client can send multiple requests on the same connection, and you could have Varnish add a " Connection: close " header before calling the connection stack.

] Delivery the object cached to the client. Normally the call is made from vcl_fetch .

Does an ESI process of the document purchased.

If you want to know more about VCL do not miss this tutorial which also contains functions that you can perform on your site.

Sample configurations

I hope you're learning something (or a lot) from Varnish, but the best way to start to play with is to see some sample configuration files .

The web of the Varnish community has a huge collection of sample configurations which are a good place to start doing yours. There are even some great sample configurations for WordPress from fetch and receive in Github .

I think that at this point it goes without saying that Varnish is very customizable and that can do wonders for any WordPress installation especially those with high traffic. Also, it must be recognized, it is not for anyone, at least you have to have knowledge of connection with servers through Linux.

The best thing is that, with little effort and free, you can configure a really powerful cache with Varnish, based on the user permissions, in the type of user or whatever you can think of.

If you want more evidence of the power of Varnish, not only WordPress Help uses it, too Facebook and I think there is no better high traffic web test than this tremendous social network do not you think?

WordPress plugins

There are, as I mentioned a few days ago, WordPress plugins that allow you to configure or manage the behavior of Varnish in WordPress, which you will find are these:

Well, do you dare to try Varnish or have you used it?

NOTICE : this publication is from two years ago or more. If it's a code or a plugin it might not work in the latest versions of WordPress, and if it's a news story it might be obsolete. Then do not say we have not warned you.

Loading …

That may also help you:

Mascot for WordPress • WordPress Help

I've been wondering for a long time because WordPress does not have a pet that unites and identifies the community beyond the official logo that, although pleasant, it does not manage to win the affections that a pet always lavishes.

We have only to see the rest of free software mascots that delight the users, how are you …

Not to mention the amount of merchandising that could be created with a pet that would delight users, like t-shirts, mugs, dolls, everything.

And nothing, that it occurred to me that we could pose a contest in order to create the WordPress Mascot among all the users, that surely there are many good designers.

The idea is to create a pet and a description of why we have chosen it [1 9459012]why we believe it identifies WordPress. And not to monopolize the idea I do not ask you to send it to me or anything like that but you believe it and publish it on your own blog (if you do not have it, you can send it to mascot@ayudawordpress.com ) linking to this post to keep track of trackbacks . Within, let's say, one month I do a compilation in a post with links to your post of the mascot and we do a vote among all the users .

Do you think it's a good idea ?, is it more, do you dare?

Now that I fall, this is his thing, then move it to the people of Automattic, expand it to English-speaking blogs, etc., right?

NOTICE : this publication It's two or more years ago. If it's a code or a plugin it might not work in the latest versions of WordPress, and if it's a news story it might be obsolete. Then do not say we have not warned you.

Loading …

That may also help you:

5 reasons why you should use WordPress instead of Joomla • WordPress Help

Although with a little delay I take the witness released by David in Not only code to give my counterpart to the exposed reasons of the virtues of Joomla on WordPress . I hope you take it well, by way of small amiable and friendly discussion.

I apologize for the " copy-paste ", which I consider necessary for this small web-controversy ] David, you have put it to me to egg : mrgreen:

The reasons are basically the following:

  1. When you need something more than a blog . With WordPress we are very limited to the structure of a blog. With Joomla we can create any navigation structure for our website.

    Because WordPress works for all types of websites, including blogs . With WordPress a long time ago we are not limited to the structure of a blog, but manages them wonderfully, much better than Joomla. WordPress, in addition, is the best publishing platform for content and it is the templates that define the format, be it blog, magazine, portal etc. There are thousands, only you decide the final aspect.

  2. More and more diverse extensions. Joomla has a extensions catalog broader than WordPress, from virtual stores to ticketing systems. In addition, the professional sector is more focused on Joomla, so if you need some payment at a certain time, it is easier to find it ..

    More and more different plugins. WordPress currently has more than 6,400 plugins compared to just over 3,200 extensions for Joomla. And that despite the veteranity of Joomla and the huge community of users and developers. This effervescence of WordPress is unparalleled and speaks of its very good health compared to the apparent, stalemate of Joomla. Of course, there are WordPress plugins for virtually any need you may have on your website, also in professional and paid options. WordPress has not been a CMS for bloggers for some time, but a professional environment used by the most prestigious sites.

  3. More power. Many people say that WordPress is more than just a blog and that you can create really complex sites. It is true that WordPress is a very powerful tool, but it is much more. For something it must be that Joomla is chosen in multitude of public institutions like system in charge to manage its contents.

    More power . Joomla has long ceased to be a standard, and if you currently see many institutions that still use it to a large extent, it is because a few years ago "it was what it was". Every day there are more and more institutions and customers who are asking for the Joomla to WordPress migration to have a simpler administration, a more powerful publication system and a better management in general. Do you want examples? . Already there are no appreciable differences in terms of power .

  4. More sophisticated template system. The Joomla template system is far more elegant than WordPress. The template is defined in a single file, where you can see the entire XHTML structure of the page and make changes in a very comfortable way. WordPress is a mess of files difficult to understand. Still, the WordPress system is also very powerful. This encourages many companies to develop professional templates for Joomla, which can get us out of a hurry at a certain moment.

    Simpler and more sophisticated theme system . Faced with the "veteran" hodgepodge (said finely) of Joomla, WordPress offers a system of themes where everything is in place, and can quickly identify which part to modify your website by simply retouching the appropriate file (header, footer, sidebar). This intelligent system allows you to have everything under control, properly organize the structure and gives greater versatility . Let's not say the multidisciplinary file " functions.php " or the child themes and frameworks .

  5. Easier to customize . Due to all the above, it is easier to get what you want, therefore will make you more productive in your daily work and you are a professional, you will earn more money.

    Easier to customize . As everything is better structured, everything in its place, the personalizations are simple and allow you to have more control of the changes. You can use files of some themes in others, just changing the CSS styles and classes, which saves time and takes advantage of the work for a client as possible solutions for others. As a professional you will like to have everything under control. I'm afraid that in usability WordPress also wins Joomla .

  6. API object oriented more elegant and powerful . This is an inclusion of mine, I have not been able to remedy it. Many times I have read that Joomla is bad for developers because its API is bad. I believe that the Joomla API is very well resolved and very elegant . It uses well-known programming patterns and is designed to create quite complex extensions. Maybe that's why Joomla extensions are of higher quality than their competitors.

    I've already talked in the second point of how the WordPress plugins API allows enormous versatility. Despite its youth, WordPress has evolved in such a way that currently its possibilities are practically endless, the imagination of the developer is the only limit, but to ask Andres Nieto .

Come on David, no, although I respect your admiration for Joomla when I read your post this summer it seemed to me that it was written a year and a half or two years ago

WordPress is currently far from what you present as arguments in favor of Joomla, and see that I do not want any harm to Joomla (if at all to the management of images, that I hate her deeply), and I am aware that there are other CMS and for have doubts you can even integrate WordPress and Joomla and if not then migrates from Joomla to WordPress .

Today WordPress is king moving away of false myths and it is here for leave, grow and improve, you just have to see the evolution of WordPress versus other CMS . Tomorrow we'll see.

Of course, this post is done with all the love, just as a healthy discussion exercise between passionate CMS

NOTICE : this publication is two years or more ago. If it's a code or a plugin it might not work in the latest versions of WordPress, and if it's a news story it might be obsolete. Then do not say we have not warned you.

Loading …

That may also help you:

Subscription to blogs in real time by IM • WordPress Help

The idea is that you subscribe to the posts and comments of your favorite sites, created with WordPress, through your preferred instant messaging client, using the protocol Jabber ( XMPP ]), a free service with which many of today's instant messaging clients are compatible, as long as they are multiprotocol (such as Adium [Mac] or Pidgin [Windows y Linux] or almost any existing iPhone client).

Once you have chosen a client that supports Jabber messages in HTML, like the ones mentioned, you only have to add as a contact to bot@im.wordpress.com and you can subscribe – for now – to any site created in WordPress.com through your address of type misitio.wordpress.com and you will receive in real time, you can even respond to a post through your messaging client.

There are many more features , that pued is to check on the page of WordPress support in Jabber as well as the list of commands to use to subscribe to a blog, unsubscribe, etc.

WordPress on Ubuntu

In Cybernauts have created a simple and visual tutorial of how to install WordPress locally on Linux Ubuntu using XAMPP for Linux.

As we have already covered as ] install WordPress locally in Windows and in Mac OS X with this guide you have no excuse for try WordPress on your computer whatever your operating system.

WordPress Comments Moderator • WordPress Help

Interestingly the development that is ending Daniel Dura: WordPress Comments Moderator a cross-platform application (Windows, Linux, Mac OS X) for Adobe AIR that offers moderate the comments of your blog from the desktop of your computer .

You will think that you do not need something like that because for that you have installed the browser but what do you think if I tell you that the application "warn" you when there are comments pending moderation?

The program interface allows you to approve, reject or mark as spam comments, if you use Mac OS X you shows in the Dock how many you have pending a joy.

Still a couple of weeks are missing for it to be available but sign up and do not stop trying it, I'll make sure.

How to hire a good WordPress hosting

Now maybe the free hosting you got tired, and you want to leave WordPress.com ; have more independence … Hiring a paid hosting is a step that at some point we all give (or at least, we wish).

 Hosting Linux Web Servers PHP

But as we all know, choose a good hosting that responds, that is stable, fast and not of configuration problems, it is difficult task. Therefore, here I will try to explain for beginners (and why not for those who want to review), certain aspects that it is advisable to take into account at the time of hire a hosting plan for WordPress or any other project, how to choose plans, see transfer, etc.

NOTE: aimed at main, basic users. If you are a more experienced user, it is good to read it, but perhaps not much.

The most important thing is to define some ideas (with a lot of imagination):

  1. What use are we going to give? Take the hosting like an empty lot where we want to build a house. According to whether we want one or two floors, we must build the foundations according to it. Well, that is a choice between: Windows or Unix / Linux . If you are going to work with WordPress, you must choose Linux (then I'll explain why)
  2. What material will it be? It's very difficult … But it will be important to choose and build the columns and main pillars, the floors themselves, and some walls. That is called PHP or ASP with its respective databases, file systems, etc … PHP is managed with Linux while ASP with Windows platform. Eye! some Windows based services allow PHP, but it is not advisable to hire them.
  3. Once the materials have been chosen, and with a certain idea, we will have to build the columns and pillars: This is called CMS or Management System Contents, that is, your WordPress or Joomla, Drupal, etc … Attention: these systems, in our case WordPress, use PHP and MySQL (on Linux servers).
  4. Now if we go to the walls ! patience! This should be the last step to follow: you must complete the entire tutorial and then return here. The walls, with their colors and frames will be your theme (template, skin, face, design, etc.). While the furniture and amenities, will be the plugins .

Well, leaving a little aside the illustration of your blog as a house; we will explain some more technical concepts and aspects where you should pay attention :

  • Web space (the square meters of land): it is the available space that you buy to make use of it. It is measured in Mb (megabytes), and you can usually start comfortably with 50Mb
  • Monthly transfer (taxes): visually it works like a road toll (the one that charges you for traveling on a highway or road). If you have many visits, you will use more "transfer". It is measured monthly, and in the GigaByte unit (Gb). A personal blog, on average, does not use more than 1Gb or 2Gb per month. Lately some companies prefer to express it in Mb, and offer 1000Mb, which is equivalent to 1Gb (approx.)
  • Availability and connection speed : this is very important, but maybe not at the beginning when you are undemanding. It is good to visit other sites hosted in that company, see if they open quickly and that they do not fall regularly. It is also interesting to ask and verify in the service conditions (contract) if there are limitations of "memory usage" or "php memory" or something similar. If you are going to have a website with a lot of national traffic, you can entrust it to a more specific company in your country instead of a very international one.
  • Make sure to try technical support send emails with half of your doubts, and then a second when they have answered. If you do not know English, it is better to hire in a company that speaks your language : The Internet is not only the United States, there are good services in Spain, Argentina, Brazil, Chile, and even some in Miami (where there is great Spanish-speaking population).

As for hosting, it would be enough. Now you must choose an Address like your home: Street 2, 2nd floor, 4th floor, etc … or rather a "domain" it can be www. vivoencalle2piso2.com . Some companies do not register all types of domains, especially ".tv, .info, .biz, or country domains (.com.ar, .es, etc.).

Finally, read, reread and verify again and again the characteristics of the plan . Sometimes, it can happen, that we hire, and then we find that it does not have FTP access, or such or such thing. That is often a mistake of not paying enough attention, beyond the scam companies.

It is very useful to search in Google about that company, it is commented a lot in forums about them the service; because the comments or experiences that may be published on the web hosting are often edited or censored.

What else to say, is a basic guide, if you want more! you will already learn it 🙂

NOTICE : this publication is from two years ago or more. If it's a code or a plugin it might not work in the latest versions of WordPress, and if it's a news story it might be obsolete. Then do not say we have not warned you.

Loading …

That may also help you:

Error 404 in xmlrpc.php

The desktop clients to post on blogs are great options for times when you're not connected or a proxy prevents you from accessing your blog. Then, when you have the open connection, you publish them. Now, there are times that you can not send your blog entries from these clients due to a Error 404 with the xmlrpc.php .

This is usually due to server security restrictions which your hosting provider has set to avoid problems with older versions of WordPress, for example.

Well, do not worry because this has an easy solution, you just have to add the following lines to your file .htaccess of the blog:

This code tells the Apache server to exclude the xmlrpc.php file from the security check .

Important note : Do not forget that the end of line of the .htaccess file is of the Unix type (LF) before sending it modified to your server, if it is a server based on Unix (Linux and derivatives). otherwise you can get a nice Error500.

How to install plugins manually in WordPress • WordPress Help

We have already been several months and still lacked a clear and explanatory guide about how to install plugins in WordPress . Although something Guillermo advanced us some time ago, I think some more clarification was needed, especially at the time of activation in your blog.

I'll try to get it …

The basic process is the following:

1. Download the plugin

Normally, it will be in the form of a compressed (zip) file. You download it, unzip it on your computer and you will see – one of two – a folder or a simple file. In some cases it will be accompanied by a text file with explanations about its use and installation I recommend that you always read it.

The main file of the plugin is usually a file with extension .php where, if you open it with a text editor, you will see that it also usually gives information about its function, author, version, etc. This information is what is usually displayed in the plugins management window of your blog.

Also, depending on the plugin, it may be accompanied with other files and folders.

2. Upload the plugin to your server

You must upload the folder or file of the plugin to your server. The path where you should always stay is " wp-content / plugins / ", once you have uploaded it as " wp-content / plugins / miplugin / " – if it is a folder – or " wp-content / plugins / miplugin.php " if it is a simple file.

To upload files you can use three methods mainly:

  1. FTP Client – You have to enter the access data to the server provided by your hosting provider. You have very good free clients for Mac, Linux and Windows, and everyone does their work quickly and easily, even allowing uploading files with the drag and drop procedure. It is my recommended option.
  2. Hosting Control Panel – On many occasions, although not always, your hosting provider will have a file browser from which you can perform file uploading, downloading, editing and almost anything you would do with an FTP client. The advantage is that everything you do from the browser and no need to install any application on your computer.
  3. OneClick / MyFTP – These plugins for WordPress allow you to upload and install plugins and themes without leaving the administration panel of your WordPress blog. Its main advantage is that you do not have to decompress the downloaded plugin before on your computer because they do it for you.

Of course, there are more options but what you get with all of them is more or less this …

And as we mentioned before, depending on whether the plugins come in the folder or not you can have both types within the directory .

3. Activate the Plugin

Once you have the files in the right place you must access your control panel WordPress and go to the Plugins window . You will see a list of the available ones, where you can distinguish the active from the inactive by their different color and the link that offers you "Activate" or "Deactivate".

[19659003] You only have to do click on "Activate" and your plugin will be installed completely.

Now, you should keep in mind at this point that some plugins need some configuration. There are two possibilities for this:

    1. Options Page – In the Options window of your administration panel you will find sections for the configuration of some plugins. It is always advisable to visit them and customize their operation so that it adapts to the function they must perform, and sometimes you can even configure their appearance.

  1. Insertion of Code – In many (yes, many) occasions you must activate the plugin by inserting some type of code in the files of your template . It is a method that may seem old and even cause you insecurity if you have no familiarity with programming, but it is a very safe and adaptable way to include functions … especially if they are facing your readers. In this way you will not only offer what the plugin gives you but you can even decide yourself where to show your virtues . Normally in the README file of the plugin in question will tell you what is the code to include, where you can add it and even if you have variable parameters that you can adjust. Some very popular that use this method are those of Lester Chan . For example, in the documentation of use of WP-PageNavi tells you that to activate it completely you must include the following code in the place where you want the "Digg style" navigation menu offered by the plugin to appear.

    In the case of this plugin, it is advisable to add this code in the file footer.php of your template (usually before the tag )


That's it. I hope to have clarified some not very obvious aspects of installing plugins and, if you dare, you can visit the download area and install some that offer interesting features.

Do not forget to visit the blog if do not want to miss the next installment, where we will explain in detail how to install and launch the themes (templates). If you do not want to miss any article you already know that you can subscribe to the Feed by RSS or Email and receive the news on your computer.

If you liked the tutorial or want to comment Any opinion about it, please discuss it with me.

NOTICE : this publication is from two years ago or more. If it's a code or a plugin it might not work in the latest versions of WordPress, and if it's a news story it might be obsolete. Then do not say we have not warned you.

Loading …

That may also help you: