Normally, this presents an issue for users of these websites because it means that each time you visit them you will receive a new, unoptimized webpage.Here at https://afrohistorama.info/ has some more information about dynamic content for static web pages.
Cache is a technology developed by Google which allows web developers to cache their static website so visitors only need to load it once and then continue browsing content from there instead of loading a fresh page each time.
- When the Cache is Enabled
This article assumes that you already have a working website which you want to use cached. This means that your website uses HTML for structure, CSS for styling, and perhaps images and other media for imagery.
When a page is cached it means that the information on the webpage will be stored locally on the visitor’s computer, therefore it won’t have to load from your website each time they visit.
This also means that as a website developer, you can continue to update your web content without worrying that those changes will have no effect.
- Implementing the Cache
There are many different ways to implement caching, but I will describe how to use the Cache by using Google’s own web server. It is recommended to install this software on your webserver because you can benefit from its features.
To make Cache work, you’ll need to find the IP address of your webserver. For this, use the Command Prompt on Windows or Terminal on Mac OS X to list server information, including IP addresses. For example:
When you have found the IP address, use an online service like Namecheap or Name.com to purchase a domain name for your website.
A cache is a representation of data stored for quicker access. In the context of the web, a cache is a collection of files stored on server disks that can be served more quickly than they can be generated.
Caching is a technique to reduce latency and improve performance by storing copies of frequently accessed resources nearby or offline, so that these resources can be served with less dependence on remote systems
Since everyone wants to have their website load as quickly as possible, it would make sense to take advantage of caching where possible.
In this article I am going to discuss how caching works and what you need to do in order to implement it.
1.What is a cache and what types of caching exists?
Caching is a process that saves or stores copies of resources that client devices request frequently, and then makes them available again quickly if the client requests them again. Caching is used in many applications such as web browsers, servers, and databases.
It is common to use local caching across multiple machines which share the same files, but it can also be used with standalone caching on a single machine.
The common meaning of caching in this article refers to resources on a server which need to be served repeatedly to different users. Resources for instance images may be cached and their contents will be replaced after each request.
2. When to use a cache?
Sites with a lot of static data can benefit from caching. Content that is static and not going to change every second. Think for instance about a weather site or a translation site, these sites will remain mostly constant and generate very little traffic. Sites that contains dynamic content such as live news or applications such as Facebook should not use caching. Examples of pages that could be cached are:
- Login page after login, users will always want to go back to the homepage either using the back button in their browser or clicking on the quicklinks: “Logout” and “Login” in the top right corner of the page.
- Main category pages: which is the main page for each category of your website. An example would be http://www.oscommerce.com/shop/gifts .
- After the user is done browsing the gifts category they will want to go back to the homepage using either their browser’s back button or clicking on the quicklinks: “Home”, “Gifts”, “Watches” or “Cards” in the top right corner of this page.
3.How does caching work?
One option is to use the htaccess file approach.This approach involves editing the htaccess files on your web server and adding/changing rules which would cache certain parts of the website. This method is good for small websites with few pages, but it will not work very well on large websites.