3 Server Caching Techniques That Improve Your Hosting

Caching is the temporary storage of every now and again got to information in higher speed media (regularly SRAM or RAM) for more proficient recovery. Web caching stores much of the time utilized protests nearer to the customer through the proxy, browser, or server caches.

Cache-Control with mod_expires and mod_headers

For Apache, mod_expires and mod_headers handle reserve control through HTTP headers sent from the server. Since they have not introduced as a matter of course, have your server head enter them for you. For Apache/1.3x, empower the lapses and headers modules by adding the accompanying lines to your httpd.conf setup document.

LoadModule expires_module libexec/mod_expires.so
LoadModule headers_module libexec/mod_headers.so
AddModule mod_expires.c
AddModule mod_headers.c

AddModule mod_gzip.c

Note that the heap request is essential in Apache/1.3x, mod_gzip must load last, after every other module.

Target Files by Extension for Caching

One fast approach to enable store control headers for existing sites is to focus documents by expansion. Despite the fact that this technique has a few detriments (strikingly the necessity of file augmentations), it has the prudence of effortlessness. To turn on mod_expires set ExpiresActive to on.

Target Files by MIME Type

The inconvenience of the above technique is the dependence on the presence of document expansions. Now and again web site admins choose to utilize extensionless URLs for compactness and execution (see Rewrite URLs with Content Negotiation). A superior technique is to use the ExpiresByType order of the mod_expires module. As the name infers, ExpiresByType targets assets for reserving by MIME sort.

Leave a Reply

Your email address will not be published. Required fields are marked *