{"id":26276,"date":"2015-05-13T00:22:05","date_gmt":"2015-05-12T21:22:05","guid":{"rendered":"http:\/\/blog.superhosting.bg\/en\/?p=26276"},"modified":"2022-04-02T11:08:04","modified_gmt":"2022-04-02T08:08:04","slug":"web-cache-web-accelerators","status":"publish","type":"post","link":"https:\/\/blog.superhosting.bg\/en\/web-cache-web-accelerators.html","title":{"rendered":"Caching Systems and Web Acceleration"},"content":{"rendered":"<p class=\"p1\"><span class=\"s1\">In the beginning of&nbsp;the <strong><span class=\"s2\">web<\/span><\/strong>, when websites consisted of just&nbsp;<strong><span class=\"s2\">HTML<\/span><\/strong>&nbsp;files with more&nbsp;<strong><span class=\"s2\">text<\/span><\/strong>&nbsp;and fewer images, the page loading speed was not yet a key factor for a good user experience.<\/span><\/p>\n<p class=\"p1\"><span class=\"s1\">However, when the web became dynamic, i.e. when websites began offering dynamically generated content, the page loading speed began directly to influence the good interactive web users experience. Apart from working with HTML files, the web serves were given the task of operating with script languages, which in turn operate in close cooperation with databases. The size and complexity of web information is increasing which leads to a lag&nbsp;<\/span><span class=\"s1\">in delivering the web content to the web users.<\/span><\/p>\n<p class=\"p1\"><span class=\"s1\">The server performs intensive operating tasks to load just a single page from a dynamic website. Scripts are running that process data, SQL queries to the database are being executed, as well as various other processes, just to generate the information the user is expecting.<\/span><\/p>\n<h4 class=\"p2\"><span class=\"s1\"><b>Web cache<\/b><\/span><\/h4>\n<p class=\"p1\"><span class=\"s1\">The word &#8216;cache&#8217; means &#8216;to store, hide&#8217;. And&nbsp;<a href=\"https:\/\/en.wikipedia.org\/wiki\/Web_cache\" target=\"_blank\" rel=\"noopener\">web cache<\/a>&nbsp;means storing web information.<\/span><\/p>\n<p class=\"p1\"><span class=\"s1\">Although the information in web pages is now generated dynamically, it does not change every second. That means the same information is being distributed to all users, but for each user it will be generated anew. That process of dynamic generation of the same information is done all the time, upon every access. That leads to unnecessary use of resources<\/span><span style=\"font-size: 130%;\">&nbsp;<\/span><span class=\"s1\">such as time, CPU resources, RAM, and etc.<\/span><\/p>\n<p class=\"p1\"><span class=\"s1\">Because of this waste of time and resources, which directly affects the website loading time, certain technologies were created to store the generated information. After the dynamically generated information is saved (cached), it turns into static content. Such information is provided to users directly, without generation, waiting or lag.<\/span><\/p>\n<p class=\"p1\"><span class=\"s1\">Caching of information for upcoming use is an effective way to accelerate the loading of a dynamic website. When compression of such saved information is applied, the downloading time for the user is accelerated<\/span><span style=\"font-size: 130%;\">&nbsp;<\/span><span class=\"s1\">even more.<\/span><\/p>\n<p class=\"p1\"><span class=\"s1\">Web caching and compression:<\/span><\/p>\n<p class=\"p1\"><span class=\"s2\">\u2022 <\/span><span class=\"s1\">decreases the waiting time;<\/span><span class=\"s3\"><br \/>\n<\/span><span class=\"s1\">\u2022 decreases network traffic;&nbsp;decreases the amount of information transferred through the web;<\/span><span class=\"s3\"><br \/>\n<\/span><span class=\"s1\">\u2022 decreases the CPU usage and the web server load;<\/span><span class=\"s3\"><br \/>\n<\/span><span class=\"s1\">\u2022 facilitates faster access and faster web resources loading.<\/span><\/p>\n<h4 class=\"p2\"><span class=\"s1\"><b>Caching Systems and Web Acceleration<\/b><\/span><\/h4>\n<p class=\"p1\"><span class=\"s1\">The acceleration systems on the web (also called&nbsp;<a href=\"https:\/\/en.wikipedia.org\/wiki\/Web_accelerator\">web accelerators<\/a>) use information caching as part of their overall function. Apart from caching, such acceleration systems may feature compression, filtering, preliminary download of resources and others.<\/span><\/p>\n<p class=\"p4\"><span class=\"s1\">Any web information can be cached locally at the user&#8217;s end \u2013&nbsp;<b>Browser Cache<\/b>, before the source server of the web content \u2013&nbsp;<b>Reverse Proxy<\/b>\/<b>Web Accelerator<\/b>&nbsp;or at the source server itself,&nbsp;<b>at an application level<\/b>.<\/span><\/p>\n<p class=\"p4\" style=\"text-align:center;\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full\" src=\"\/wp-content\/uploads\/2015\/05\/web-cache-reverse-proxy-en-superhosting.png\" alt=\"web-cache-reverse-proxy-en-superhosting\" width=\"490\" height=\"334\"><\/p>\n<p style=\"text-align: center;\">\n<p><strong><span style=\"color: #db6466;\">Cache miss &#8212;&nbsp;<\/span><\/strong><span class=\"s1\"><b>(the information you are looking for is not available in the cache)<\/b><\/span><\/p>\n<p class=\"p3\" style=\"padding-left: 30px;\"><span class=\"s1\">(<b>1<\/b>) The web browser sends a query to the server corresponding to the respective domain, about the page.html web resource, the query is detected by the proxy server;<\/span><span class=\"s2\"><br \/>\n<\/span><span class=\"s1\">(<b>2<\/b>) The proxy server checks the cache for the page and does not find it. Such omission can be called&nbsp;<b>Cache miss<\/b>.<\/span><span class=\"s2\"><br \/>\n<\/span><span class=\"s1\">(<b>3<\/b>) The proxy server sends a query regarding the resource to the source server.<\/span><span class=\"s2\"><br \/>\n<\/span><span class=\"s1\">(<b>4<\/b>) The source server returns the demanded web page to the proxy.<\/span><span class=\"s2\"><br \/>\n<\/span><span class=\"s1\">(<b>5<\/b>) The proxy server receives, copies the web resource and sends it back to the web client.<\/span><span class=\"s2\"><br \/>\n<\/span><span class=\"s1\">(<b>6<\/b>) The web browser receives the demanded web resource.<\/span><\/p>\n<p><strong><span style=\"color: #a9e969;\">Cache hit &#8212;&nbsp;<\/span><\/strong><span class=\"s1\"><b>(the information you are looking for is available in the cache)<\/b><\/span><\/p>\n<p class=\"p3\" style=\"padding-left: 30px;\"><span class=\"s1\">(<b>A<\/b>) The web browser sends a query about the page.html web resource to the server corresponding to the demanded domain, and the query is detected by the proxy server (since the proxy server is located before the source server).<\/span><span class=\"s2\"><br \/>\n<\/span><span class=\"s1\">(<b>B<\/b>) The proxy server checks the cache for the page and finds it \u2013&nbsp;<b>Cache hit<\/b>. The proxy server supplies the web resource directly to the client, this time without going through the resource server.<\/span><\/p>\n<p class=\"p1\"><span class=\"s1\"><b>What is Browser Cache?<\/b><\/span><span class=\"s2\"><br \/>\n<\/span><span class=\"s1\">The user&#8217;s web browser may cache objects from websites such as images, scripts, pages, etc. When a website is accessed, the web browser will first check if the objects on the website are not already available in the cache. If the objects are saved and&nbsp;are still up to date, the browser will load them from the cache, instead of connecting to the web server. Loading data from the web browser&#8217;s cache is much faster than downloading them from the web server. Sometimes, after implementing changes to a website, in order to see the latest information on the site, it may be necessary to<strong>&nbsp;<span class=\"s3\">clear the cached data in the web browser<\/span><\/strong>.<\/span><\/p>\n<p class=\"p1\"><span class=\"s1\"><b>What is Reverse Proxy?<\/b><\/span><span class=\"s2\"><br \/>\n<a href=\"https:\/\/en.wikipedia.org\/wiki\/Reverse_proxy\" target=\"_blank\" rel=\"noopener\">Reverse Proxy<\/a><\/span><span class=\"s1\">&nbsp;is a type of&nbsp;<a href=\"https:\/\/en.wikipedia.org\/wiki\/Proxy_server\" target=\"_blank\" rel=\"noopener\">proxy server<\/a>&nbsp;(a mediator between a web client and a web server) and one of its functions is caching. A Reverse Proxy may be placed before the web server and users will connect to the proxy server, instead of directly to the web server.<\/span><\/p>\n<p class=\"p1\"><span class=\"s1\">Some of the useful functions the Reverse Proxy may perform are the following:<\/span><span class=\"s2\"><br \/>\n<\/span><span class=\"s1\">\u2022 decreasing the web server load through effective caching of the static and dynamic content (web accelerator);<\/span><span class=\"s2\"><br \/>\n<\/span><span class=\"s1\">\u2022 decreasing the time for accessing the website;<\/span><span class=\"s2\"><br \/>\n<\/span><span class=\"s1\">\u2022 load distribution, if there are more than one web servers behind the proxy;<\/span><span class=\"s2\"><br \/>\n<\/span><span class=\"s1\">\u2022 protection against general web based attacks;<\/span><span class=\"s2\"><br \/>\n<\/span><span class=\"s1\">\u2022 content compression for quicker web page loading;<\/span><\/p>\n<p class=\"p1\"><span class=\"s1\">Apps that are web accelerators and may be used for Reverse Proxy caching:<a href=\"https:\/\/www.varnish-cache.org\/\" target=\"_blank\" rel=\"noopener\"><b>Varnish<\/b><\/a>,&nbsp;<a href=\"http:\/\/www.squid-cache.org\/\" target=\"_blank\" rel=\"noopener\">&gt;<b>Squid<\/b><\/a>,&nbsp;<a href=\"https:\/\/trafficserver.apache.org\/\" target=\"_blank\" rel=\"noopener\"><b>Apache Traffic Server<\/b><\/a>,&nbsp;<a href=\"http:\/\/nginx.org\/\" target=\"_blank\" rel=\"noopener\"><b>Nginx<\/b><\/a>&nbsp;and others.<\/span><\/p>\n<div id=\"boxcolorp5mb12red\">\n<p class=\"p1\"><span class=\"s1\"><b>Services for which you can use these technologies:&nbsp;<\/b><a href=\"https:\/\/en.superhosting.bg\/web-hosting-page-servers-vps.php\" target=\"_blank\" rel=\"noopener\"><b>CloudVPS<\/b><\/a><b>&nbsp;and&nbsp;<\/b><a href=\"https:\/\/en.superhosting.bg\/web-hosting-page-servers-vps.php\" target=\"_blank\" rel=\"noopener\"><b>VPS<\/b><\/a>.<\/span><\/p>\n<\/div>\n<p class=\"p1\"><span class=\"s1\">When working with virtual servers you can use any caching system and acceleration technique that is compatible with the platform, settings and the objectives of the web project.<\/span><\/p>\n<p style=\"padding-left: 30px;\">When working with Cloud virtual servers, just as with ordinary virtual servers, you can use any type of systems and techniques to optimize and accelerate the web projects. The Cloud platform, apart from its&nbsp;<strong><span class=\"s2\">key advantage<\/span><\/strong>, also has another, rather organizational advantage \u2013 within a single customer account you can create, reinstall and remove as much virtual servers as you wish. Apart from the VPS where your site is located, you can also create additional VPSs that would serve for certain accelerating, caching purposes. You can create Load Balancers, you can install web accelerators and proxy caching servers. These optimization tools may be placed before the main virtual server, in order to balance the load and accelerate the access and loading of the web project.<\/p>\n<p class=\"p1\"><span class=\"s1\"><b>Caching technologies at app level<\/b><\/span><span class=\"s2\"><br \/>\n<\/span><span class=\"s1\">There are various systems and technologies for caching data internally, on the application server.&nbsp;<strong><span class=\"s3\">Memcache<\/span><\/strong>, APC and eAccelerator are examples of such caching technologies.<\/span><\/p>\n<div id=\"boxcolorp5mb12red\">\n<p class=\"p1\"><span class=\"s1\"><b>Services for which you can use these technologies:<\/b>&nbsp;<a href=\"https:\/\/en.superhosting.bg\/web-hosting-compare-hosting-plans.php\" target=\"_blank\" rel=\"noopener\">&gt;<b>Shared hosting<\/b><\/a>,&nbsp;<a href=\"https:\/\/en.superhosting.bg\/web-hosting-page-servers-vps.php\" target=\"_blank\" rel=\"noopener\"><b>CloudVPS<\/b><\/a>&nbsp;and&nbsp;<a href=\"https:\/\/en.superhosting.bg\/web-hosting-page-servers-vps.php\" target=\"_blank\" rel=\"noopener\"><b>VPS<\/b><\/a>.<\/span><\/p>\n<\/div>\n<p class=\"p1\"><span class=\"s1\">Data caching is a reliable method for optimizing the speed of web apps, but it is not the only one. This method alone is not enough when other optimizations need to be applied at a lower level.<\/span><\/p>\n<p class=\"p1\"><span class=\"s1\">The Reverse Proxy caching approach towards information only works for website traffic generated by anonymous users. When the site is accessed by a user who is logged into the system, no data caching is applied.<\/span><\/p>\n<div id=\"boxcolorp5mb12blue\">\n<p class=\"p1\"><span class=\"s1\"><b>Fun fact:<\/b>&nbsp;Apart from the technologies and systems mentioned above, the main goal of which is to accelerate the web apps and the access to them, there are other available caching types.<\/span><span class=\"s2\"><br \/>\n<\/span><span class=\"s1\">For example, the Google search engine also caches web data. For every site visited by the Google bot, a cache version is created. That caching is especially useful in case a website is temporarily unavailable, because it can still be loaded&nbsp;<a href=\"http:\/\/cachedview.com\/\" target=\"_blank\" rel=\"noopener\">through the cache<\/a>.<\/span><\/p>\n<\/div>\n<p class=\"p1\"><span class=\"s1\">Also, there are specific systems that create and manage a web archive of websites such as&nbsp;<a href=\"http:\/\/archive.org\/web\/\" target=\"_blank\" rel=\"noopener\"><b>The Internet Archive<\/b><\/a>.<\/span><\/p>\n<p class=\"p3\"><span class=\"s1\">More caching:&nbsp;<span class=\"s3\"><b>DNS cache servers<\/b><\/span>. The DNS information of a domain is saved onto the DNS servers of Internet providers. So, upon the next access to this domain, the cached DNS information is used, instead of sending queries to the DNS root servers.<\/span><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Web cache means storing web information. Caching of information for upcoming use is an effective way to accelerate the loading of a dynamic website.<\/p>\n","protected":false},"author":16,"featured_media":62205,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"inline_featured_image":false,"_lmt_disableupdate":"","_lmt_disable":"","footnotes":""},"categories":[110,31],"tags":[378,224],"class_list":{"0":"post-26276","1":"post","2":"type-post","3":"status-publish","4":"format-standard","5":"has-post-thumbnail","7":"category-superhosting-technology-en","8":"category-superhosting-technology","9":"tag-supercache-en","10":"tag-website-speed-up"},"aioseo_notices":[],"modified_by":"\u041c\u0430\u0434\u043b\u0435\u043d\u0430 \u041c\u0435\u0442\u043e\u0434\u0438\u0435\u0432\u0430","post_mailing_queue_ids":[],"_links":{"self":[{"href":"https:\/\/blog.superhosting.bg\/en\/wp-json\/wp\/v2\/posts\/26276","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.superhosting.bg\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.superhosting.bg\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.superhosting.bg\/en\/wp-json\/wp\/v2\/users\/16"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.superhosting.bg\/en\/wp-json\/wp\/v2\/comments?post=26276"}],"version-history":[{"count":9,"href":"https:\/\/blog.superhosting.bg\/en\/wp-json\/wp\/v2\/posts\/26276\/revisions"}],"predecessor-version":[{"id":65445,"href":"https:\/\/blog.superhosting.bg\/en\/wp-json\/wp\/v2\/posts\/26276\/revisions\/65445"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/blog.superhosting.bg\/en\/wp-json\/wp\/v2\/media\/62205"}],"wp:attachment":[{"href":"https:\/\/blog.superhosting.bg\/en\/wp-json\/wp\/v2\/media?parent=26276"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.superhosting.bg\/en\/wp-json\/wp\/v2\/categories?post=26276"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.superhosting.bg\/en\/wp-json\/wp\/v2\/tags?post=26276"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}