Author Archives: ruben

Redirecting images in WordPress

This week I have had the opportunity for go to a WPO event that reviewed how rise the performance of a blog based in WordPress and I decided apply some ideas that were presented there in my blog.

One of the things that were spoken is that necessary separate the statics (or uploads) of the principal domain for lower the time of loading page (because much of popular navigators loads the contents in parallel mode if they have different domains between they).
Continue reading

Google and Oauth2

This week I had to work with the Google api for a project and I’m caught my attention the systems that they have for authenticate and use your services. It seems perfect. Unfortunately its documentation is just the opposite, so I will explain the steps that I had to do for if someone helps you.

Before continue, tell that you have two ways for use the Google api in your application php. The first is using the class that Google have implemented and published in your repository. The other option is write your own code using only that the services that you need.
Continue reading

Long time ago…

This function is interesting for put in to a typical news column for indicate the time ago that the news are published o for show the time spend between publish posts in to a forum.

The use is more easy, only you need call function indicating the data in format (YYYY-MM-DD) that is the default data format that return MySQL.
Continue reading

How configure Varnish 3 for use with ESI

One of improvements that I was impressed on the last version of varnish is the support of ESI language and, although the previous version was implemented part of this language, this did not works well.

Cache diagram with ESIFor the people that don’t know that I’m talking, ESI is a mark up language that permit mark parts of a web page for are cached for independent time of the rest of the web. Imagine that you have in your home a part that is 100% static (logo, menu,..) and you have other dynamically parts (a news column for example). The traditional systems, until now, only permit cached a full page so if you want update the news column, you have send to you cache system the order for update the full page (include the static parts that you do not updated). With ESI, you can indicate that only update a part of the page (in this case, the news column) so rest page is not updated saving the memory, cpu and traffic cost.
Continue reading

Get the browser you are using the client

This is the typical function that, some times, is necessary for finish view well our web.

Is true that HTML5 and the scripts how Modernizer that exists, simplifies the form to show the elements of the web in a browser but, some times is good know how discriminate by browser that user view us site, and actuate as the case (for example, for show a plug-in for download in case of a browser or an other).
Continue reading

varnish-cache

How clean the cache on Varnish 3

Recently I started with Varnish and it’s so interesting. For the people that don’t know Varnish-cache is a proxy-cache that you can install on web server and, configured correctly, it can make that your web fly.

How works is easy to understand, when Varnish is installed, you need indicate where must go to request the information that the users are requesting to it. So when the visitors look your web, Varnish download your web for next, send it to users and save the result the time that you indicate. In this time, if other users request your web, if the info is not changed, Varnish do no need to request the web again, saving the bandwidth and cpu, and accomplishing that your web fly.
Continue reading