We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 7c21aca commit fe43a11Copy full SHA for fe43a11
packages/app/src/sandbox/eval/cache.js
@@ -9,6 +9,7 @@ const debug = _debug('cs:compiler:cache');
9
10
const host = process.env.CODESANDBOX_HOST;
11
12
+const MAX_CACHE_SIZE = 1024 * 1024 * 7;
13
let APICacheUsed = false;
14
15
try {
@@ -71,6 +72,10 @@ export async function saveCache(
71
72
if (shouldSaveOnlineCache(firstRun, changes) && SCRIPT_VERSION) {
73
const stringifiedManagerState = JSON.stringify(managerState);
74
75
+ if (stringifiedManagerState.length > MAX_CACHE_SIZE) {
76
+ return Promise.resolve(false);
77
+ }
78
+
79
debug(
80
'Saving cache of ' +
81
(stringifiedManagerState.length / 1024).toFixed(2) +
0 commit comments