What are "caches" in relation to web applications?

Asked

Viewed 41 times

1

In the Inphinit Framework it is possible to cache HTTP responses, see an example:

Route::set('GET', '/hello', function () {
    $cache = new Cache;

    if ($cache->cached()) {
        return;
    }

    return str_repeat('Hello, world! ', 1000);
});

Note that I only need one class object Cache then just call the method cached() to work.

However, the very resource of cache already leaves me some doubts about what it represents for my application.

Doubts

  1. What are caches in relation to web applications?
  2. What does the cache have to do with the HTTP protocol? I always have to use? It is only linked to the answers?
No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.