Cache and its need in A site

Cache and its need in A site

One of the most important parameters in the technical management of websites today – is the speed of operation of the site.A site that runs slowly will not gain “viewers’ sympathy” (viewers for that matter = site visitors / potential customers who are worth money / and Google score also comes in here because of the direct impact on the topic of promotion and placement in the list of search results).In general there are many factors that affect the speed of the site and in most cases these are issues on the part of the site such as build quality (efficient and correct code writing) and how it works behind the scenes (a site with dozens of active plugins is a recipe for slow activity) and less server problems.Cache memory has over time become a must-have component when it comes to improving site speed and positively impacting the above viewer list.

So what exactly is cache memory?

Cache memory, also known as “cache memory”, is actually a term for a complete technology whose main purpose is to improve the operating times of the required process.The premise of this technology is to reduce the operations that take place in the source that is supposed to provide the information and use the results of calculating the identity of the layer made and stored in a temporary repository.In the world of computing in general, actions are performed by a request from one “demanding” party (for the purpose of the client) in front of the person who is supposed to provide the answer “the source” (for the purpose of the server).The source receives the request from the customer and performs a number of actions and calculations, at the end of which he presents the customer with the desired result.The cache actually performs a temporary retention of the process summary: “What is the customer’s request and what is the end result obtained.” So if the same request comes from another customer, the source does not have to “try” again with calculations and actions but uses the existing result in the cache.This results in double efficiency, the source (the server) makes less effort and functions better, and on the other hand the customer enjoys receiving a response more quickly.

Types of cache memory

There are cache mechanisms and systems on a variety of levels in the world of computing, here are some notable examples:

Hard disk cache –

This is largely a saving on the computing operations performed between the storage system and the other components in the local system (for example, our personal computer). In each operation in which information is required to be retrieved from the hard drive, a set of computational operations is performed in a complex algorithm. Because there is a period of time and resources allocated to this process, the essence of the request and the desired result for reuse are stored in the cache memory.

Cache memory at the DNS array level –

The global DNS system communicates and updates through queries performed between different components that have a certain hierarchy in the global network. In order to optimize and improve the speed of deciphering the required mathematical exercise from the DNS system: “Take a domain address and tell me what its IP is”, use a cache at the DNS level (this cache is usually related to your ISP or higher and important factors somewhere High up in the Internet Ivory Tower).

Browser Cache –

This is already becoming a little more relevant to the purpose for which we have gathered here today. Browsers nowadays as the sites themselves reflect an activity hugely complex of many factors and resources behind the scenes (you can see simply clicking on the F12 developer tools in the browser and look at the tab network ….) All the proposed site, and even the most simple, do not submit requires (client) only static content Such as an html page but a set of image files (jpg, gif), JavaScript files, css files, links to external sites, special fonts, API calls and much more…. In fact, when I first enter a site, my browser downloads a lot of content and performs a number of actions (which it remembers on the browser cache) – this is so that the next time I visit the site, the loading time will be much faster (because I already saved some data… .) This can explain why a change you made to your site, such as editing a page or any other content change, will not be reflected in a test to browse the site in another window you have opened in your browser.By the way it is important to know that it is not always simple and easy to remove this cache, sometimes it is enough to enter the site through the incognito window or delete the cache through the browser clearing settings, and sometimes the cache is really stubborn and the only way to see the site as it really is It is only through web browsing / proxy server that provides web browsing without reference to your browser.

Let’s dive a little into the subject of cache in the context of your site

For initial illustration, suppose we have a WordPress site on a storage server. A particular customer accesses the site through one of his devices connected to the network. Once his request (by and large the most common requests are: GET- for receiving data from the site, loading a page for example or POST request- for sending information to the server such as entering contact data) exiting the browser and reaching the server a number of actions take place. The site system uses several components simultaneously (the WEB server goes into action and handles the request, the MYSQL database is required to provide materials or update information entering the site system and the PHP component that connects all systems….) This means that even for requesting simple access to the home page ( GET) Pyrotechnic antics can be performed in the background that do not embarrass the best traditional circuses (it all depends on the way we built the site, the quantity and quality of plugins, etc.… as I mentioned in the introduction)

The server-side cache – is broadly divided into two types:

Full Page Cache Cache: This is actually a description of the cache we’ve talked about so far Object Cache Cache: This is a partial and point cache memory for a particular component / activity in the context of the code on the storage server (usually PHP) So forward to work

How to begin?

The active cache on the part of the site system usually comes through a ready-made plugin such as wp-rocket or LiteSpeed ​​Cache. It is important to note that the existence of a single cache plugin (!!!) must be ensured in the site mechanism and is solely responsible for the issue of cache and content optimization. Using more than one cache component means a safe recipe for various and odd problems. Each site requires special cahce settings and may even be “broken” by activating certain functions. The validity of the cache is a given parameter for change through the plugin settings as well as the scope of activity and exclusion of certain data from the cache system for example.

How do I make sure the cache is active on my site?

Once we have installed and configured the cache plugin in the site system, we can check the success of the system in several ways.In normal access to your site through the browser, we press F12 to access the developer tool. Under the “NETWORK” tab we can see all the components loaded on the same page that the browser displays. On one side we can see the list of uploaded components (images, widgets, external links, etc.) and on the other side in the same row we can see the source of the request. If we see a mention of the word cahce, it means that the component is being loaded from the cache, here is an illustration from our website:

How do I clear the cache?

Sounds simple but can be very challenging. Suppose we have performed an update on the site that is not reflected in the eyes of the surfers and we want to expedite the cleaning process (I mention that the cache is valid, the cache system managed by the plugin should refresh status by checking the site source at the specified time and updating the cache data). You can start with an initial cleaning through the plugin (usually there is a button – purge cache). The next step, if the button is not enough, is to delete the content from the cache folder directly in the file system on the storage server. Here are some common folders in acceptable paths (depending on the relevant user on the server):/user/cache /user/lscache /user/public_html/wp-content/cache

It is very important –

We must understand that even if we “destroyed-destroyed-eliminated” any trace of the cache in our site system and even in the files on the storage server, it is very possible (and almost certain) that the surfer will reach our site through his browser. In fact, it comes to a version that is stored in the local browser cache, and until there is a refresh from the side of the browser of the same client (either proactively or by the built-in settings) – the surfer will not see the change we just made on the home page. It is important to understand the above situation and wait patiently from the moment we make a certain change on the site, there is a high probability that it is very possible and a certain period of time will pass until the change is reflected in everyone who accesses the site.