Skip to content

Commit

Permalink
Temporary disable localStorage caching since it does not account for …
Browse files Browse the repository at this point in the history
…the fact that localStorage is shared between different pages
  • Loading branch information
klesun committed Aug 15, 2024
1 parent 2352dca commit 68e595a
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/WorkerManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ const mobileCheck = function() {
};

// on my 4-core PC 3 workers seems to be the optimal solution
// on iOS or on any mobile device with poor network connection better to use just one, as each worker
// on iOS or on any mobile device with poor network connection better to use just one, as each worker
// downloads and individual instance of typescript compiler which is the bottleneck of loading time
const NUM_OF_WORKERS = mobileCheck() ? 1 : 3;

Expand Down Expand Up @@ -266,7 +266,9 @@ const WorkerManager = ({compilerOptions}) => {
await crypto.subtle.digest(
'SHA-256', sourceCodeBytes
).then(bufferToHex);
const fromCache = !checksum ? null : getFromCache({fullUrl, checksum});
// fuuuuuuuuck localStorage is domain wide, but links in cache are relative!!!
// const fromCache = !checksum ? null : getFromCache({fullUrl, checksum});
const fromCache = null;
if (fromCache) {
// ensure `url` won't be taken from cache, as it
// is often used as key without extension outside
Expand Down

0 comments on commit 68e595a

Please sign in to comment.