There are different methods that we allow a speed of our server using. Htaccess Apache (httpd.conf). These methods are really simple and surely will get a significant increase in the performance of our sites .
Before you see the options that we offer this kind of cache must know that the situation must use and therefore we came good know the type of cache that there .
Types of cache
We can say that there are three types of cache: cache and browser cache and proxy cache gateway .
Each of them has a purpose and can be combine with each other .
Each type can be used in various ways, for example, the browser cache is private and is present in the user machine so it can only be used by a single user.
The cache proxy intervenes in the client-server communication and serve different pages to users , often used by Internet service providers (ISPs), universities and businesses to conserve bandwidth.
The cache gateway operated by the server itself ‘to’ and does not distinguish between users.
Why use the cache in the browser?
This type of cache
occurs between the client and the server , allows us to save copies of the responses to the client (HTML, images, style sheets), the operation is simple because the next time the customer These records need not bother to ask the server and use the copy previously saved .
With this type of cache will get
reducing latency and reduce traffic needed to resolve the petitions .
We reduce the latency because the cache is located on the client side and we get better response times to serve when the page.
We reduce traffic because when receiving fewer requests from the client the bandwidth needed to serve the page is lower.
Cache and Apache. Htaccess
We must be clear that there are three basic mechanisms to control the cache site.
- Freshness , allows a response to be used again without checking the server.
response header (header) Expires provides a date when the document expires, and directive Cache-Control: max-age informs the customer of the number of seconds during which the answer is valid.
- Validation , allows us to check whether a reply cached remains good after cadudar.
Last-Modified header , the client may make a request using conditional header If-Modified-Since to find out if the page changed.
- Invalidation , is a side effect of another request .
Example: If a URL associated with an answer through a header and we make a request
POST, PUT or DELETE at the same reply, the cache is invalidated.
You can find additional information on htaccess Caching.
# 1 YEAR
Cache-Control header in September "max-age = 29030400, public"
# 1 WEEK
Cache-Control header in September “max-age = 604800, public”
# 2 DAYS
Cache-Control header in September “max-age = 172800, proxy-revalidate”
# 1 MINUTE
Cache-Control header in September “max-age = 60, private, proxy-revalidate”
One of the main goals for a manager is to provide the best service possible and this requires quick access to content, in this sense There are many levels of software solutions that enable our cache website
<> The best thing is <> at least two solutions to analyze and test its operation and increased performance that involve <> every one of them, once evaluated data <> the election will be much more optimal <>.<>