Questions tagged [cacheapi]

49 questions
0
votes
0 answers

Use Axios instead of Fetch with Cache API

I am successfully using fetch to download an image file and store in a custom cache: await fetch(url).then( async (response) => { if (!response.ok) { throw new TypeError("Bad response status"); } return cache.put(url, response); }); I…
Lauren
  • 743
  • 3
  • 12
  • 24
0
votes
1 answer

Displaying cached image via Cache API

I'm trying to use the Cache API to store large files (one being 500MB) for offline use. I'm able to create/open the cache, fetch the image URL from AWS S3, and put it into the cache: let cache = await caches.open('my-cache'); let url =…
Lauren
  • 743
  • 3
  • 12
  • 24
0
votes
0 answers

Trying to set up service worker for caching, it never installs

So, I am trying to build a PWA and I am just getting familiar with caching/service workers. I found some examples online that all seem to be the same, and I am trying to cache a few of my routes. However, it simply doesn't do anything. const…
Lee Morgan
  • 550
  • 1
  • 6
  • 26
0
votes
2 answers

SQL equivalent of Javax Cache 'put' (INSERT or UPDATE)

I am using javax cache along with database. I uses cache's APIs to get/put/delete entities and the database is behind this cache. For this,I am using CacheLoader and CacheWriter. So, following are SQL's construct equivalent to cache API SELECT ->…
SuhasD
  • 728
  • 2
  • 7
  • 20
0
votes
1 answer

Play mp3 from cache without service worker using react-player

In my react application I would like to play an mp3 file that was manually cached before using the cache api. The file is located on a different site, so I am using the no-cors mode to fetch it and put an opaque response into the cache. My question…
JoeCool
  • 129
  • 7
0
votes
1 answer

How to load website offline from base url using Service Workers and Cache Api?

When you visit this web site https://bugs.stringmanolo.ga/index.html, while navigating around the main.js file is calling a method from ff.js file to cache a good amount of the resources. So next time you land to the web the files are directly taken…
0
votes
0 answers

Cache api - add XMLHttpRequest object

I have just started using Cache API of javascript. I need to set a header in all my GET request, hence i passed in my request object to the "add" method like the following, //Request object construction let xmlHttp = new…
0
votes
1 answer

Service Worker Fetching Cached Assets Failure

Hello every one i'm new in service worker and i'm facing this error The FetchEvent for "" resulted in a network error response: the promise was rejected. i don't know what it means this is what happens when i click offline and…
0
votes
1 answer

JS Cache API: Cached Images served by Google Cloud Bucket don't load

I'm writing a web app, where the user can download images for a later offline usage using the Cache API. // when the user clicks the download button window.caches.open("imageCache").then(function(cache) { cache.add(imageUrls) …
hendra
  • 2,531
  • 5
  • 22
  • 34
0
votes
2 answers

Chrome Cache-API - caches match

I have cached resources with CacheAddall method with a version say "v22" with the v22 version there are many files as for example below: Now how I can access the same and update or delete individually. I can access the v22 with…
Joshi
  • 2,730
  • 5
  • 36
  • 62
0
votes
1 answer

Map.get() returns undefined inside async function

I want to get a list of all the different caches existing in the Cache API and how many assets each cache has. Even though I have managed to return the Map object with the info, when calling Map.get(cacheName) I get undefined. I've seen that once…
AgoHH
  • 180
  • 1
  • 14
0
votes
0 answers

Unexplained LightHouse start_url audit error

I'm running a PWA LightHouse audit with the ServiceWorker code below. The audit reports failures: - . Current page does not respond with a 200 when offline . start_url does not respond with a 200 when offline The PWA is recognized as…
0
votes
2 answers

Browser Cache API is not working for cookie authenticated services

I am trying browser Cache API mechanism, but the api which is going to be cached is using cookie authentication. And am receiving 'unauthorized-401' error message. I am suspecting the http cookie supposed to send for all the api request is not…
0
votes
1 answer

Cache API with MVC Views

I have a basic MVC form and I've been trying to use the Javascript Cache API to cache all my css, js, html files so that when users (people in the field) do not have reliable access, they can still use my web form. Obviously I'm using IndexedDB and…
0
votes
0 answers

How to implement an offline form in Angular?

I am trying to implement an Angular form on my website where a user will enter data when they are offline and it will automatically be saved in the backend when the user comes online.