emscripten-core / emscripten-core/emscripten

EMSCRIPTEN_FETCH_NO_DOWNLOAD still attempts http get

Open
#13,096 1 comment 0 reactions 0 assignees View on GitHub
wontfix
Dominant language
C++
Stars
27.6k
Forks
3.6k
Avg merge
1d 1h
Merged PRs (30d)
105

Description

```
emscripten_fetch_attr_t attr;
emscripten_fetch_attr_init(&attr);
{
// what this does: fetch file from IndexedDB if exists
strcpy(attr.requestMethod, "GET");
attr.attributes =
EMSCRIPTEN_FETCH_LOAD_TO_MEMORY /* s.t. we get the actual bytes of data */ |
EMSCRIPTEN_FETCH_PERSIST_FILE /* from IndexedDB */ |
EMSCRIPTEN_FETCH_NO_DOWNLOAD /* prevent falling back to xhs get if not in IndexedDB */;

attr.userData = this;
attr.onsuccess = downloadSucceeded;
attr.onerror = downloadFailed;
}
```
Hi, I'm attempting the above, but it looks like this still attempts to fetch over the network if the file doesn't exist in IndexedDB

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.