'Accessing caches on a html page?

When I try to open console on my domain's index.html and try to access

caches on Latest Chrome it gives me

caches VM1520:1 Uncaught ReferenceError: caches is not defined at :1:1

But, when I do the same process on stackoverflow or any other sites, it gives me empty list of caches hence the command works there. So how can I support my website to support the cache method?

I have tried using navigation.serviceworkers that also fails



Solution 1:[1]

As per:

https://developer.mozilla.org/en-US/docs/Web/API/CacheStorage

Note

Chrome and Safari only expose CacheStorage to the windowed context over HTTPS. WorkerGlobalScope.caches will be undefined unless an SSL certificate is configured.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Lee Taylor