{"id":477522,"date":"2026-04-27T04:48:11","date_gmt":"2026-04-27T04:48:11","guid":{"rendered":"https:\/\/savepearlharbor.com\/?p=477522"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=477522","title":{"rendered":"\u041a\u0430\u043a \u044f \u043f\u043e\u0441\u0442\u0440\u043e\u0438\u043b \u043a\u0435\u0448 \u0441\u0442\u0440\u0430\u043d\u0438\u0446 \u0434\u043b\u044f \u043c\u043d\u043e\u0433\u043e\u0434\u043e\u043c\u0435\u043d\u043d\u043e\u0433\u043e \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e PVC \u0438 \u043a\u0430\u0441\u0442\u043e\u043c\u043d\u043e\u0433\u043e \u043f\u043e\u0434\u0445\u043e\u0434\u0430"},"content":{"rendered":"<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<p>\u0423 \u043c\u0435\u043d\u044f \u0431\u044b\u043b \u043f\u0440\u043e\u0435\u043a\u0442, \u0433\u0434\u0435 \u043e\u0434\u0438\u043d Next.js \u0441\u0430\u0439\u0442 \u043e\u0431\u0441\u043b\u0443\u0436\u0438\u0432\u0430\u043b \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0434\u043e\u043c\u0435\u043d\u043e\u0432, \u0438 \u0432\u043e\u0437\u043d\u0438\u043a\u043b\u0430 \u0437\u0430\u0434\u0430\u0447\u0430 &#8212; \u044d\u0444\u0444\u0435\u043a\u0442\u0438\u0432\u043d\u043e \u043a\u0435\u0448\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u044b, \u0447\u0442\u043e\u0431\u044b \u043d\u0435 \u043f\u0435\u0440\u0435\u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u0438\u0445 \u043a\u0430\u0436\u0434\u044b\u0439 \u0440\u0430\u0437. \u0421\u043d\u0430\u0447\u0430\u043b\u0430 \u044f \u043f\u043e\u043f\u0440\u043e\u0431\u043e\u0432\u0430\u043b \u0432\u043d\u0435\u0434\u0440\u0438\u0442\u044c \u043a\u0435\u0448\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u0447\u0435\u0440\u0435\u0437 Redis: \u044f \u043d\u0430\u043f\u0438\u0441\u0430\u043b \u0445\u0435\u043d\u0434\u043b\u0435\u0440, \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u043b \u0435\u0433\u043e, \u043d\u043e \u0432\u0441\u043a\u043e\u0440\u0435 \u043e\u0431\u043d\u0430\u0440\u0443\u0436\u0438\u043b, \u0447\u0442\u043e Redis \u043f\u043e\u0442\u0440\u0435\u0431\u043b\u044f\u0435\u0442 \u043a\u043e\u043b\u043e\u0441\u0441\u0430\u043b\u044c\u043d\u044b\u0439 \u043e\u0431\u044a\u0451\u043c \u043e\u043f\u0435\u0440\u0430\u0442\u0438\u0432\u043d\u043e\u0439 \u043f\u0430\u043c\u044f\u0442\u0438 &#8212; \u043f\u043e\u0440\u044f\u0434\u043a\u0430 100 \u0413\u0411, \u0438 \u044d\u0442\u043e \u043f\u0440\u0438 \u0442\u043e\u043c, \u0447\u0442\u043e \u0435\u0449\u0451 \u043d\u0435 \u0432\u0441\u0435 \u0437\u0430\u043f\u0440\u043e\u0441\u044b \u0431\u044b\u043b\u0438 \u0437\u0430\u043a\u0435\u0448\u0438\u0440\u043e\u0432\u0430\u043d\u044b. \u0422\u043e\u0433\u0434\u0430 \u044f \u0440\u0435\u0448\u0438\u043b \u043f\u043e\u0438\u0441\u043a\u0430\u0442\u044c \u0434\u0440\u0443\u0433\u043e\u0439 \u043f\u043e\u0434\u0445\u043e\u0434 \u0438 \u043e\u0431\u0440\u0430\u0442\u0438\u043b \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435 \u043d\u0430 PVC &#8212; \u043e\u0431\u0449\u0435\u0435 \u0445\u0440\u0430\u043d\u0438\u043b\u0438\u0449\u0435, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u043c\u043e\u0433\u043b\u0438 \u0431\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0432\u0441\u0435 \u043f\u043e\u0434\u044b.  \u042f \u043d\u0430\u0447\u0430\u043b \u0438\u0437\u0443\u0447\u0430\u0442\u044c \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u044b \u0440\u0430\u0431\u043e\u0442\u044b \u0441 PVC \u0438 \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u0431\u044b\u0441\u0442\u0440\u043e \u043f\u0440\u0438\u0448\u0451\u043b \u043a \u0438\u0434\u0435\u0435 \u043e\u0431\u0449\u0435\u0433\u043e \u043a\u0435\u0448-\u0445\u0440\u0430\u043d\u0438\u043b\u0438\u0449\u0430 \u0434\u043b\u044f \u0432\u0441\u0435\u0445 \u043f\u043e\u0434\u043e\u0432. \u042f \u043f\u043e\u043f\u0440\u043e\u0431\u043e\u0432\u0430\u043b \u043f\u0440\u043e\u0441\u0442\u043e \u043f\u0438\u0441\u0430\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0435 \u0432 PVC, \u043d\u043e \u0441\u0442\u043e\u043b\u043a\u043d\u0443\u043b\u0441\u044f \u0441 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u043e\u0439: \u043a\u0430\u0436\u0434\u044b\u0439 \u0440\u0430\u0437, \u043a\u043e\u0433\u0434\u0430 \u043f\u043e\u0434 \u043f\u043e\u0434\u043d\u0438\u043c\u0430\u043b\u0441\u044f, \u043e\u043d \u043f\u0435\u0440\u0435\u0437\u0430\u043f\u0438\u0441\u044b\u0432\u0430\u043b \u043a\u0435\u0448. \u0414\u043e \u0442\u0435\u0445 \u043f\u043e\u0440, \u043f\u043e\u043a\u0430 \u043d\u0435 \u043f\u043e\u0434\u043d\u044f\u0442\u044b \u0432\u0441\u0435 \u043f\u043e\u0434\u044b, \u0434\u0430\u043d\u043d\u044b\u0435 \u043f\u043e\u0441\u0442\u043e\u044f\u043d\u043d\u043e \u043f\u0435\u0440\u0435\u0437\u0430\u043f\u0438\u0441\u044b\u0432\u0430\u043b\u0438\u0441\u044c, \u0430 \u043c\u043d\u0435 \u043d\u0443\u0436\u043d\u043e \u0431\u044b\u043b\u043e, \u0447\u0442\u043e\u0431\u044b \u043f\u0435\u0440\u0432\u044b\u0439 \u043f\u043e\u0434 \u0437\u0430\u043f\u0438\u0441\u0430\u043b \u0434\u0430\u043d\u043d\u044b\u0435, \u0430 \u043f\u043e\u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u0447\u0438\u0442\u0430\u043b\u0438 \u0438\u0445. \u042f \u043d\u0430\u0447\u0430\u043b \u0438\u0441\u043a\u0430\u0442\u044c, \u043a\u0430\u043a \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u043a\u0430\u0441\u0442\u043e\u043c\u043d\u044b\u0439 \u043a\u0435\u0448-\u0445\u0435\u043d\u0434\u043b\u0435\u0440, \u043d\u043e \u0433\u043e\u0442\u043e\u0432\u044b\u0445 \u0440\u0435\u0448\u0435\u043d\u0438\u0439 \u043d\u0435 \u043d\u0430\u0448\u0451\u043b.  <\/p>\n<p>    \u042f \u043d\u0430\u0448\u0451\u043b \u0432 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438 Next.js \u0443\u043f\u043e\u043c\u0438\u043d\u0430\u043d\u0438\u0435 \u043e \u043a\u0430\u0441\u0442\u043e\u043c\u043d\u044b\u0445 \u043a\u0435\u0448-\u0445\u0435\u043d\u0434\u043b\u0435\u0440\u0430\u0445 (<a href=\"https:\/\/nextjs.org\/docs\/app\/api-reference\/config\/next-config-js\/cacheHandlers\" rel=\"noopener noreferrer nofollow\">\u0432\u043e\u0442 \u0441\u0441\u044b\u043b\u043a\u0430<\/a>), \u043d\u043e \u0442\u0430\u043c \u043f\u043e\u043a\u0430\u0437\u0430\u043d \u0442\u043e\u043b\u044c\u043a\u043e \u043c\u0438\u043d\u0438\u043c\u0430\u043b\u044c\u043d\u044b\u0439 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 \u043a\u0435\u0448-\u0445\u0435\u043d\u0434\u043b\u0435\u0440\u0430, \u0431\u0435\u0437 \u0434\u0435\u0442\u0430\u043b\u0435\u0439 \u043f\u0440\u043e shared storage, \u0438\u043d\u0432\u0430\u043b\u0438\u0434\u0430\u0446\u0438\u044e \u0438 \u043a\u043e\u043d\u043a\u0443\u0440\u0435\u043d\u0446\u0438\u044e \u0447\u0442\u0435\u043d\u0438\u044f\/\u0437\u0430\u043f\u0438\u0441\u0438 \u0438 \u043d\u0435 \u0431\u044b\u043b\u043e \u043f\u0440\u0438\u043c\u0435\u0440\u0430, \u043a\u0430\u043a \u044d\u0442\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0441 PVC. \u0420\u0430\u0437\u0431\u0438\u0440\u0430\u044f\u0441\u044c, \u044f \u043f\u043e\u043d\u044f\u043b, \u0447\u0442\u043e \u0443 \u043a\u0435\u0448-\u0445\u0435\u043d\u0434\u043b\u0435\u0440\u0430 \u0435\u0441\u0442\u044c \u043a\u043b\u044e\u0447\u0435\u0432\u044b\u0435 \u043c\u0435\u0442\u043e\u0434\u044b. <code>set<\/code> &#8212; \u043e\u0442\u0432\u0435\u0447\u0430\u0435\u0442 \u0437\u0430 \u0441\u043e\u0445\u0440\u0430\u043d\u0435\u043d\u0438\u0435 \u0434\u0430\u043d\u043d\u044b\u0445, <code>get<\/code> &#8212; \u0437\u0430 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u0435, \u0430 <code>revalidateTag<\/code> &#8212; \u043e\u0431\u043d\u043e\u0432\u043b\u044f\u0435\u0442 \u0434\u0430\u043d\u043d\u044b\u0435 \u043f\u043e \u0442\u0435\u0433\u0430\u043c.  \u0414\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u043e\u0431\u0449\u0438\u043c \u0445\u0440\u0430\u043d\u0438\u043b\u0438\u0449\u0435\u043c \u043c\u043d\u0435 \u0442\u0430\u043a\u0436\u0435 \u043f\u0440\u0438\u0448\u043b\u043e\u0441\u044c \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e \u043f\u0440\u043e\u0434\u0443\u043c\u0430\u0442\u044c \u0441\u0435\u0440\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044e \u0438 \u0434\u0435\u0441\u0435\u0440\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044e \u0437\u0430\u043f\u0438\u0441\u0435\u0439 \u043d\u0430 \u0441\u0442\u043e\u0440\u043e\u043d\u0435 Node.js. \u042f \u0441\u043e\u0437\u0434\u0430\u043b \u0445\u0440\u0430\u043d\u0438\u043b\u0438\u0449\u0435 \u043d\u0430 PVC, \u0433\u0434\u0435 \u0437\u0430\u043f\u0438\u0441\u044b\u0432\u0430\u043b \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u044b, \u0430 \u043f\u043e\u0434\u044b \u0437\u0430\u0442\u0435\u043c \u0447\u0438\u0442\u0430\u043b\u0438 \u0434\u0430\u043d\u043d\u044b\u0435 \u043e\u0442\u0442\u0443\u0434\u0430. \u0422\u0430\u043a \u044f \u043f\u043e\u043b\u0443\u0447\u0438\u043b \u0446\u0435\u043d\u0442\u0440\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u043d\u043e\u0435 \u043a\u0435\u0448\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435.  \u0412\u043e\u0442 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u043a\u0435\u0448-\u0445\u0435\u043d\u0434\u043b\u0435\u0440\u0430 \u0438\u0437 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438:<\/p>\n<pre><code class=\"javascript\">const cacheHandler = {  async get(cacheKey, softTags) {    const entry = cache.get(cacheKey)    if (!entry) return undefined     \/\/ Check if expired    const now = Date.now()    if (now &gt; entry.timestamp + entry.revalidate * 1000) {      return undefined    }     return entry  },    async set(cacheKey, pendingEntry) {    \/\/ Wait for the entry to be ready    const entry = await pendingEntry     \/\/ Store in your cache system    cache.set(cacheKey, entry)  },}<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><img style=\"width:87px;height:14px;object-fit:cover;object-position:left;\"\/><\/a><\/div><\/pre>\n<p>      \u0418\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f Node.js, \u044f \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043b \u043c\u0435\u0442\u043e\u0434 <code>set<\/code>, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u043e\u0434\u0433\u043e\u0442\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u0442 \u0437\u0430\u043f\u0438\u0441\u044c, \u0432\u044b\u0447\u0438\u0441\u043b\u044f\u0435\u0442 \u0441\u0440\u043e\u043a \u0435\u0451 \u0430\u043a\u0442\u0443\u0430\u043b\u044c\u043d\u043e\u0441\u0442\u0438 \u0438 \u0441\u043e\u0445\u0440\u0430\u043d\u044f\u0435\u0442 \u0434\u0430\u043d\u043d\u044b\u0435 \u0432 \u043e\u0431\u0449\u0435\u043c \u0432\u043d\u0435\u0448\u043d\u0435\u043c \u0445\u0440\u0430\u043d\u0438\u043b\u0438\u0449\u0435:<\/p>\n<p> \u041d\u0438\u0436\u0435 \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d\u044b \u0443\u043f\u0440\u043e\u0449\u0451\u043d\u043d\u044b\u0435 \u0438 \u043e\u0431\u0435\u0437\u043b\u0438\u0447\u0435\u043d\u043d\u044b\u0435 \u0444\u0440\u0430\u0433\u043c\u0435\u043d\u0442\u044b \u043a\u043e\u0434\u0430. \u041e\u043d\u0438 \u043f\u0435\u0440\u0435\u0434\u0430\u044e\u0442 \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u0443 \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u0438 \u043a\u043b\u044e\u0447\u0435\u0432\u044b\u0435 \u0438\u0434\u0435\u0438, \u043d\u043e \u043d\u0435 \u043f\u043e\u0432\u0442\u043e\u0440\u044f\u044e\u0442 \u043f\u0440\u043e\u0434\u043e\u0432\u0443\u044e \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044e \u043e\u0434\u0438\u043d \u0432 \u043e\u0434\u0438\u043d.  <\/p>\n<pre><code class=\"javascript\">async set(key, data, ctx) {  if (this.isBuildPhase || !this.storageUrl) {    return;  }  await this.initPromise;  const existingRequest = this.pendingWrites.get(key);  if (existingRequest) {    return existingRequest;  }  const entryKey = getEntryKey(key);  const request = (async () =&gt; {    try {      if (data == null) {        await storage.remove(entryKey);        return;      }      const revalidateSec = extractRevalidateSeconds(data, ctx);      const tags = parseTagsFrom(data, ctx);      const ttl = revalidateSec &gt; 0 ? revalidateSec : DEFAULT_TTL_SEC;      const now = Date.now();      const entry = {        value: data,        modifiedAt: now,        tags,        revalidateSec: ttl,        expiresAt: now + ttl * 1000,      };      await storage.write(entryKey, encodeEntry(entry), ttl);      await this.touchEntry(entryKey);      await this.evictIfNeeded();    } catch (error) {      console.error('[CacheHandler] Failed to write cache entry', error);    } finally {      this.pendingWrites.delete(key);    }  })();  this.pendingWrites.set(key, request);  return request;}<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><img style=\"width:14px;height:14px;object-fit:cover;object-position:left;\"\/><\/a><\/div><\/pre>\n<p> \u041c\u0435\u0442\u043e\u0434 <code>get<\/code> \u0447\u0438\u0442\u0430\u0435\u0442 \u0437\u0430\u043f\u0438\u0441\u044c \u0438\u0437 \u0432\u043d\u0435\u0448\u043d\u0435\u0433\u043e \u0445\u0440\u0430\u043d\u0438\u043b\u0438\u0449\u0430, \u0434\u0435\u043a\u043e\u0434\u0438\u0440\u0443\u0435\u0442 \u0435\u0451 \u0438 \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u0442, \u043d\u0435 \u0443\u0441\u0442\u0430\u0440\u0435\u043b\u0430 \u043b\u0438 \u043e\u043d\u0430 \u043f\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u0438\u043b\u0438 \u043f\u043e \u0442\u0435\u0433\u0430\u043c: <\/p>\n<pre><code class=\"javascript\">async get(key) {  if (this.isBuildPhase || !this.storageUrl) {    return null;  }  await this.initPromise;  const existingRequest = this.pendingReads.get(key);  if (existingRequest) {    return existingRequest;  }  const entryKey = getEntryKey(key);  const request = (async () =&gt; {    try {      const storage = await this.initPromise;      const rawValue = await storage.read(entryKey);      if (!rawValue) {        return null;      }      let entry;      try {        entry = decodeEntry(rawValue);      } catch (error) {        console.error('[CacheHandler] Failed to decode cache entry', error);        await storage.remove(entryKey);        return null;      }      if (        typeof entry?.expiresAt === 'number' &amp;&amp;        entry.expiresAt &gt; 0 &amp;&amp;        entry.expiresAt &lt;= Date.now()      ) {        await storage.remove(entryKey);        return null;      }      if (        entry?.tags?.length &amp;&amp;        await this.isEntryStaleByTags(entry.tags, entry.modifiedAt)      ) {        await storage.remove(entryKey);        return null;      }      await this.touchEntry(entryKey);      return entry;    } catch (error) {      console.error('[CacheHandler] Failed to read cache entry', error);      return null;    } finally {      this.pendingReads.delete(key);    }  })();  this.pendingReads.set(key, request);  return request;}<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><img style=\"width:14px;height:14px;object-fit:cover;object-position:left;\"\/><\/a><\/div><\/pre>\n<p> \u041c\u0435\u0442\u043e\u0434 <code>revalidateTag<\/code> \u043d\u0435 \u0443\u0434\u0430\u043b\u044f\u0435\u0442 \u0437\u0430\u043f\u0438\u0441\u044c \u043d\u0430\u043f\u0440\u044f\u043c\u0443\u044e, \u0430 \u043f\u043e\u043c\u0435\u0447\u0430\u0435\u0442 \u0441\u0432\u044f\u0437\u0430\u043d\u043d\u044b\u0435 \u0442\u0435\u0433\u0438 \u043a\u0430\u043a \u0438\u043d\u0432\u0430\u043b\u0438\u0434\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0435. \u0411\u043b\u0430\u0433\u043e\u0434\u0430\u0440\u044f \u044d\u0442\u043e\u043c\u0443 \u043f\u0440\u0438 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u043c \u0447\u0442\u0435\u043d\u0438\u0438 \u0443\u0441\u0442\u0430\u0440\u0435\u0432\u0448\u0430\u044f \u0437\u0430\u043f\u0438\u0441\u044c \u0431\u0443\u0434\u0435\u0442 \u043e\u0442\u0431\u0440\u043e\u0448\u0435\u043d\u0430 \u0438 \u043f\u0435\u0440\u0435\u0441\u043e\u0431\u0440\u0430\u043d\u0430 \u0437\u0430\u043d\u043e\u0432\u043e: <\/p>\n<pre><code class=\"javascript\">async revalidateTag(tags) {  if (this.isBuildPhase || !this.storageUrl) {    return;  }  await this.initPromise;  const tagsList = Array.isArray(tags) ? tags : [tags].filter(Boolean);  if (!tagsList.length) {    return;  }  const invalidatedAt = Date.now();  await storage.markTagsInvalid(tagsList, invalidatedAt);}<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><img style=\"width:14px;height:14px;object-fit:cover;object-position:left;\"\/><\/a><\/div><\/pre>\n<p>\u0422\u0430\u043a \u0448\u0430\u0433 \u0437\u0430 \u0448\u0430\u0433\u043e\u043c \u044f \u043f\u043e\u0441\u0442\u0440\u043e\u0438\u043b \u043a\u0430\u0441\u0442\u043e\u043c\u043d\u044b\u0439 \u043f\u043e\u0434\u0445\u043e\u0434, \u0438\u043d\u0442\u0435\u0433\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u0441 PVC.  <\/p>\n<p>    \u041a\u043e\u0433\u0434\u0430 \u044f \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u044b\u0432\u0430\u043b \u043a\u0430\u0441\u0442\u043e\u043c\u043d\u044b\u0439 \u043a\u0435\u0448-\u0445\u0435\u043d\u0434\u043b\u0435\u0440 \u043d\u0430 PVC, \u0443 \u043c\u0435\u043d\u044f \u0432\u043e\u0437\u043d\u0438\u043a\u043b\u0438 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b. PVC \u043c\u0435\u0434\u043b\u0435\u043d\u043d\u0435\u0435 \u043f\u0430\u043c\u044f\u0442\u0438, \u0438 \u043d\u0443\u0436\u043d\u043e \u0431\u044b\u043b\u043e \u0438\u0437\u0431\u0435\u0433\u0430\u0442\u044c \u0433\u043e\u043d\u043a\u0438. \u0412\u043e-\u043f\u0435\u0440\u0432\u044b\u0445, \u044f \u0440\u0435\u0448\u0430\u043b \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0443 \u0443\u0441\u0442\u0430\u0440\u0435\u0432\u0448\u0438\u0445 \u0434\u0430\u043d\u043d\u044b\u0445 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0444\u0443\u043d\u043a\u0446\u0438\u0438 isEntryStaleByTags:<\/p>\n<pre><code class=\"javascript\">async isEntryStaleByTags(tags, modifiedAt) {  if (!tags.length) {    return false;  }  const invalidatedAt = await storage.getTagsInvalidationTime(tags);  return invalidatedAt &gt; modifiedAt;}<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><img style=\"width:14px;height:14px;object-fit:cover;object-position:left;\"\/><\/a><\/div><\/pre>\n<p> \u0412\u043e-\u0432\u0442\u043e\u0440\u044b\u0445, \u044f \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0438\u0432\u0430\u043b \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0437\u0430\u043f\u0438\u0441\u0435\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u0435\u0439  evictIfNeeded  <em>:<\/em><\/p>\n<pre><code class=\"javascript\">async evictIfNeeded() {  const overflow = await storage.getOverflowCount();  if (overflow &lt;= 0) {    return;  }  const staleEntries = await storage.getLeastRecentlyUsed(overflow);  await storage.removeEntries(staleEntries);}<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><img style=\"width:14px;height:14px;object-fit:cover;object-position:left;\"\/><\/a><\/div><\/pre>\n<p><em>\u0412-\u0442\u0440\u0435\u0442\u044c\u0438\u0445, \u044f \u0433\u0430\u0440\u0430\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u043b, \u0447\u0442\u043e \u043f\u0440\u0438 \u0437\u0430\u043f\u0438\u0441\u0438 \u043c\u044b \u0430\u043a\u043a\u0443\u0440\u0430\u0442\u043d\u043e \u043e\u0431\u043d\u043e\u0432\u043b\u044f\u0435\u043c \u0438\u043d\u0434\u0435\u043a\u0441 (<\/em>\u043f\u0440\u0438 \u043a\u0430\u0436\u0434\u043e\u043c \u0447\u0442\u0435\u043d\u0438\u0438 \u0438\u043b\u0438 \u0437\u0430\u043f\u0438\u0441\u0438 \u044f \u043e\u0431\u043d\u043e\u0432\u043b\u044f\u044e \u0438\u043d\u0434\u0435\u043a\u0441 \u0430\u043a\u0442\u0438\u0432\u043d\u043e\u0441\u0442\u0438 \u0437\u0430\u043f\u0438\u0441\u0438, \u0447\u0442\u043e\u0431\u044b \u043c\u043e\u0436\u043d\u043e \u0431\u044b\u043b\u043e \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0438\u0432\u0430\u0442\u044c \u0440\u0430\u0437\u043c\u0435\u0440 \u043a\u0435\u0448\u0430<em>) \u0447\u0435\u0440\u0435\u0437 <\/em>touchEntry: <\/p>\n<pre><code class=\"javascript\">  async touchEntry(entryKey) {    await storage.touchIndex(entryKey, Date.now());  }<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><img style=\"width:14px;height:14px;object-fit:cover;object-position:left;\"\/><\/a><\/div><\/pre>\n<p>\u042d\u0442\u0438 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0432\u043c\u0435\u0441\u0442\u0435 \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0438\u043b\u0438 \u0430\u043a\u0442\u0443\u0430\u043b\u044c\u043d\u043e\u0441\u0442\u044c, \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u0435 \u0438 \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u043a\u0435\u0448\u0430. <\/p>\n<p>\u041e\u0442\u0434\u0435\u043b\u044c\u043d\u043e\u0439 \u0437\u0430\u0434\u0430\u0447\u0435\u0439 \u043e\u043a\u0430\u0437\u0430\u043b\u0441\u044f \u0441\u0431\u0440\u043e\u0441 \u043a\u0435\u0448\u0430. \u0412 \u043a\u0430\u043a\u043e\u0439-\u0442\u043e \u043c\u043e\u043c\u0435\u043d\u0442 \u044f \u043f\u043e\u043f\u0440\u043e\u0431\u043e\u0432\u0430\u043b \u0441\u0445\u0435\u043c\u0443 \u0441 L1-\u043a\u0435\u0448\u0435\u043c \u043d\u0430 \u043a\u0430\u0436\u0434\u043e\u043c \u043f\u043e\u0434\u0435: \u043a\u0430\u0436\u0434\u044b\u0439 \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0434\u0435\u0440\u0436\u0430\u043b \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u044b\u0439 \u0433\u043e\u0440\u044f\u0447\u0438\u0439 \u043a\u0435\u0448, \u0430 \u0434\u043b\u044f \u0441\u0438\u043d\u0445\u0440\u043e\u043d\u0438\u0437\u0430\u0446\u0438\u0438 \u0438\u043d\u0432\u0430\u043b\u0438\u0434\u0430\u0446\u0438\u0438 \u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b \u0432\u043d\u0435\u0448\u043d\u0438\u0439 \u0441\u0438\u0433\u043d\u0430\u043b \u0447\u0435\u0440\u0435\u0437 Redis. \u041d\u0430 \u043f\u0440\u0430\u043a\u0442\u0438\u043a\u0435 \u044d\u0442\u043e \u043e\u043a\u0430\u0437\u0430\u043b\u043e\u0441\u044c \u0441\u043b\u0438\u0448\u043a\u043e\u043c \u0441\u043b\u043e\u0436\u043d\u044b\u043c. \u041a\u0430\u0436\u0434\u044b\u0439 \u043f\u043e\u0434 \u0434\u043e\u043b\u0436\u0435\u043d \u0431\u044b\u043b \u043e\u0442\u0441\u043b\u0435\u0436\u0438\u0432\u0430\u0442\u044c \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u0432\u043e \u0432\u043d\u0435\u0448\u043d\u0435\u043c \u0441\u043b\u043e\u0435, \u0432\u043e\u0432\u0440\u0435\u043c\u044f \u043f\u043e\u043d\u0438\u043c\u0430\u0442\u044c, \u0447\u0442\u043e \u0434\u0430\u043d\u043d\u044b\u0435 \u0443\u0441\u0442\u0430\u0440\u0435\u043b\u0438, \u0438 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e \u0441\u0431\u0440\u0430\u0441\u044b\u0432\u0430\u0442\u044c \u0441\u0432\u043e\u0439 \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u044b\u0439 L1-\u043a\u0435\u0448. \u0427\u0435\u043c \u0431\u043e\u043b\u044c\u0448\u0435 \u043f\u043e\u0434\u043e\u0432 \u0441\u0442\u0430\u043d\u043e\u0432\u0438\u043b\u043e\u0441\u044c \u0432 \u0441\u0438\u0441\u0442\u0435\u043c\u0435, \u0442\u0435\u043c \u043c\u0435\u043d\u0435\u0435 \u0443\u0434\u043e\u0431\u043d\u043e\u0439 \u0438 \u043f\u0440\u0435\u0434\u0441\u043a\u0430\u0437\u0443\u0435\u043c\u043e\u0439 \u0432\u044b\u0433\u043b\u044f\u0434\u0435\u043b\u0430 \u0442\u0430\u043a\u0430\u044f \u0441\u0445\u0435\u043c\u0430.<\/p>\n<p>\u0412 \u0438\u0442\u043e\u0433\u0435 \u043c\u044b \u043e\u0442\u043a\u0430\u0437\u0430\u043b\u0438\u0441\u044c \u043e\u0442 \u0438\u0434\u0435\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c Redis \u043a\u0430\u043a \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u0435 \u0438\u043b\u0438 \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0438\u0440\u0443\u044e\u0449\u0435\u0435 \u0445\u0440\u0430\u043d\u0438\u043b\u0438\u0449\u0435 \u0434\u043b\u044f \u0432\u0441\u0435\u0433\u043e \u043a\u0435\u0448\u0430. \u0412\u043c\u0435\u0441\u0442\u043e \u044d\u0442\u043e\u0433\u043e Redis \u043e\u0441\u0442\u0430\u043b\u0441\u044f \u0442\u043e\u043b\u044c\u043a\u043e \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u0438\u043c \u0431\u044b\u0441\u0442\u0440\u044b\u043c L1-\u0441\u043b\u043e\u0435\u043c \u0434\u043b\u044f \u0441\u0430\u043c\u044b\u0445 \u0433\u043e\u0440\u044f\u0447\u0438\u0445 \u0437\u0430\u043f\u0438\u0441\u0435\u0439 &#8212; \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0434\u043b\u044f \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0435\u0439 \u0442\u044b\u0441\u044f\u0447\u0438 \u043d\u0430\u0438\u0431\u043e\u043b\u0435\u0435 \u043f\u043e\u0441\u0435\u0449\u0430\u0435\u043c\u044b\u0445 \u0441\u0442\u0440\u0430\u043d\u0438\u0446. \u0412\u0441\u0451 \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u043e\u0435 \u043f\u0440\u043e\u0434\u043e\u043b\u0436\u0438\u043b\u043e \u0445\u0440\u0430\u043d\u0438\u0442\u044c\u0441\u044f \u0432 PVC \u043a\u0430\u043a \u0432 \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u043c \u043e\u0431\u0449\u0435\u043c \u0445\u0440\u0430\u043d\u0438\u043b\u0438\u0449\u0435. \u0422\u0430\u043a\u043e\u0439 \u043f\u043e\u0434\u0445\u043e\u0434 \u043f\u043e\u0437\u0432\u043e\u043b\u0438\u043b \u043d\u0435 \u0440\u0430\u0437\u0434\u0443\u0432\u0430\u0442\u044c \u043f\u043e\u0442\u0440\u0435\u0431\u043b\u0435\u043d\u0438\u0435 \u043e\u043f\u0435\u0440\u0430\u0442\u0438\u0432\u043d\u043e\u0439 \u043f\u0430\u043c\u044f\u0442\u0438, \u043d\u043e \u043f\u0440\u0438 \u044d\u0442\u043e\u043c \u0441\u043e\u0445\u0440\u0430\u043d\u0438\u0442\u044c \u0431\u044b\u0441\u0442\u0440\u044b\u0439 \u0434\u043e\u0441\u0442\u0443\u043f \u043a \u0441\u0430\u043c\u043e\u0439 \u0430\u043a\u0442\u0443\u0430\u043b\u044c\u043d\u043e\u0439 \u0447\u0430\u0441\u0442\u0438 \u043a\u0435\u0448\u0430.<\/p>\n<p> \u041a\u0440\u043e\u043c\u0435 \u0442\u043e\u0433\u043e, \u043f\u0440\u0438 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0438 \u043a\u0430\u0441\u0442\u043e\u043c\u043d\u043e\u0433\u043e \u043a\u0435\u0448-\u0445\u0435\u043d\u0434\u043b\u0435\u0440\u0430 \u044f \u0434\u043e\u0431\u0430\u0432\u0438\u043b \u0435\u0433\u043e \u0432 \u0444\u0438\u043d\u0430\u043b\u044c\u043d\u044b\u0439 runtime-\u043e\u0431\u0440\u0430\u0437 \u043d\u0430 \u044d\u0442\u0430\u043f\u0435 \u0441\u0431\u043e\u0440\u043a\u0438.  <\/p>\n<pre><code class=\"javascript\">COPY --from=builder \/workspace\/custom-cache-handler.js .\/custom-cache-handler.js<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><img style=\"width:14px;height:14px;object-fit:cover;object-position:left;\"\/><\/a><\/div><\/pre>\n<p>  \u0412 <code>next.config.ts<\/code> \u044f \u0434\u043e\u0431\u0430\u0432\u0438\u043b \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044e, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442 \u043f\u0443\u0442\u044c \u043a \u043a\u0430\u0441\u0442\u043e\u043c\u043d\u043e\u043c\u0443 \u043a\u0435\u0448-\u0445\u0435\u043d\u0434\u043b\u0435\u0440\u0443 \u0447\u0435\u0440\u0435\u0437 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u044f. \u0417\u0430\u043e\u0434\u043d\u043e \u044f \u043e\u0442\u043a\u043b\u044e\u0447\u0438\u043b \u0432\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u044b\u0439 in-memory-\u043a\u0435\u0448, \u0447\u0442\u043e\u0431\u044b \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u043d\u0435 \u0440\u0430\u0441\u0445\u043e\u0434\u043e\u0432\u0430\u043b\u043e \u043b\u0438\u0448\u043d\u044e\u044e \u043f\u0430\u043c\u044f\u0442\u044c \u043f\u043e\u0432\u0435\u0440\u0445 \u0432\u043d\u0435\u0448\u043d\u0435\u0433\u043e \u0445\u0440\u0430\u043d\u0438\u043b\u0438\u0449\u0430.<\/p>\n<pre><code class=\"javascript\">  cacheHandler: process.env.HANDLER_PATH    ? path.resolve(process.env.HANDLER_PATH)    : undefined,  cacheMaxMemorySize: 0<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><img style=\"width:14px;height:14px;object-fit:cover;object-position:left;\"\/><\/a><\/div><\/pre>\n<p>\u0422\u0430\u043a \u044f \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u043b \u043a\u0430\u0441\u0442\u043e\u043c\u043d\u044b\u0439 \u043a\u0435\u0448\u2011\u0445\u0435\u043d\u0434\u043b\u0435\u0440 \u043a\u00a0Next.js, \u043e\u0442\u043a\u043b\u044e\u0447\u0438\u043b \u0432\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u044b\u0439 in\u2011memory\u2011\u043a\u044d\u0448 \u0438 \u043f\u043e\u043b\u0443\u0447\u0438\u043b \u043f\u0440\u0435\u0434\u0441\u043a\u0430\u0437\u0443\u0435\u043c\u0443\u044e \u0441\u0445\u0435\u043c\u0443 \u043a\u044d\u0448\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0432\u00a0\u043c\u043d\u043e\u0433\u043e\u043f\u043e\u0434\u043e\u0432\u043e\u043c \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u0438 \u0441\u00a0\u043e\u0431\u0449\u0438\u043c PVC. <\/p>\n<\/div>\n<p>\u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/articles\/1028314\/\">https:\/\/habr.com\/ru\/articles\/1028314\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u0423 \u043c\u0435\u043d\u044f \u0431\u044b\u043b \u043f\u0440\u043e\u0435\u043a\u0442, \u0433\u0434\u0435 \u043e\u0434\u0438\u043d Next.js \u0441\u0430\u0439\u0442 \u043e\u0431\u0441\u043b\u0443\u0436\u0438\u0432\u0430\u043b \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0434\u043e\u043c\u0435\u043d\u043e\u0432, \u0438 \u0432\u043e\u0437\u043d\u0438\u043a\u043b\u0430 \u0437\u0430\u0434\u0430\u0447\u0430 &#8212; \u044d\u0444\u0444\u0435\u043a\u0442\u0438\u0432\u043d\u043e \u043a\u0435\u0448\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u044b, \u0447\u0442\u043e\u0431\u044b \u043d\u0435 \u043f\u0435\u0440\u0435\u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u0438\u0445 \u043a\u0430\u0436\u0434\u044b\u0439 \u0440\u0430\u0437. \u0421\u043d\u0430\u0447\u0430\u043b\u0430 \u044f \u043f\u043e\u043f\u0440\u043e\u0431\u043e\u0432\u0430\u043b \u0432\u043d\u0435\u0434\u0440\u0438\u0442\u044c \u043a\u0435\u0448\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u0447\u0435\u0440\u0435\u0437 Redis: \u044f \u043d\u0430\u043f\u0438\u0441\u0430\u043b \u0445\u0435\u043d\u0434\u043b\u0435\u0440, \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u043b \u0435\u0433\u043e, \u043d\u043e \u0432\u0441\u043a\u043e\u0440\u0435 \u043e\u0431\u043d\u0430\u0440\u0443\u0436\u0438\u043b, \u0447\u0442\u043e Redis \u043f\u043e\u0442\u0440\u0435\u0431\u043b\u044f\u0435\u0442 \u043a\u043e\u043b\u043e\u0441\u0441\u0430\u043b\u044c\u043d\u044b\u0439 \u043e\u0431\u044a\u0451\u043c \u043e\u043f\u0435\u0440\u0430\u0442\u0438\u0432\u043d\u043e\u0439 \u043f\u0430\u043c\u044f\u0442\u0438 &#8212; \u043f\u043e\u0440\u044f\u0434\u043a\u0430 100 \u0413\u0411, \u0438 \u044d\u0442\u043e \u043f\u0440\u0438 \u0442\u043e\u043c, \u0447\u0442\u043e \u0435\u0449\u0451 \u043d\u0435 \u0432\u0441\u0435 \u0437\u0430\u043f\u0440\u043e\u0441\u044b \u0431\u044b\u043b\u0438 \u0437\u0430\u043a\u0435\u0448\u0438\u0440\u043e\u0432\u0430\u043d\u044b. \u0422\u043e\u0433\u0434\u0430 \u044f \u0440\u0435\u0448\u0438\u043b \u043f\u043e\u0438\u0441\u043a\u0430\u0442\u044c \u0434\u0440\u0443\u0433\u043e\u0439 \u043f\u043e\u0434\u0445\u043e\u0434 \u0438 \u043e\u0431\u0440\u0430\u0442\u0438\u043b \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435 \u043d\u0430 PVC &#8212; \u043e\u0431\u0449\u0435\u0435 \u0445\u0440\u0430\u043d\u0438\u043b\u0438\u0449\u0435, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u043c\u043e\u0433\u043b\u0438 \u0431\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0432\u0441\u0435 \u043f\u043e\u0434\u044b.  \u042f \u043d\u0430\u0447\u0430\u043b \u0438\u0437\u0443\u0447\u0430\u0442\u044c \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u044b \u0440\u0430\u0431\u043e\u0442\u044b \u0441 PVC \u0438 \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u0431\u044b\u0441\u0442\u0440\u043e \u043f\u0440\u0438\u0448\u0451\u043b \u043a \u0438\u0434\u0435\u0435 \u043e\u0431\u0449\u0435\u0433\u043e \u043a\u0435\u0448-\u0445\u0440\u0430\u043d\u0438\u043b\u0438\u0449\u0430 \u0434\u043b\u044f \u0432\u0441\u0435\u0445 \u043f\u043e\u0434\u043e\u0432. \u042f \u043f\u043e\u043f\u0440\u043e\u0431\u043e\u0432\u0430\u043b \u043f\u0440\u043e\u0441\u0442\u043e \u043f\u0438\u0441\u0430\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0435 \u0432 PVC, \u043d\u043e \u0441\u0442\u043e\u043b\u043a\u043d\u0443\u043b\u0441\u044f \u0441 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u043e\u0439: \u043a\u0430\u0436\u0434\u044b\u0439 \u0440\u0430\u0437, \u043a\u043e\u0433\u0434\u0430 \u043f\u043e\u0434 \u043f\u043e\u0434\u043d\u0438\u043c\u0430\u043b\u0441\u044f, \u043e\u043d \u043f\u0435\u0440\u0435\u0437\u0430\u043f\u0438\u0441\u044b\u0432\u0430\u043b \u043a\u0435\u0448. \u0414\u043e \u0442\u0435\u0445 \u043f\u043e\u0440, \u043f\u043e\u043a\u0430 \u043d\u0435 \u043f\u043e\u0434\u043d\u044f\u0442\u044b \u0432\u0441\u0435 \u043f\u043e\u0434\u044b, \u0434\u0430\u043d\u043d\u044b\u0435 \u043f\u043e\u0441\u0442\u043e\u044f\u043d\u043d\u043e \u043f\u0435\u0440\u0435\u0437\u0430\u043f\u0438\u0441\u044b\u0432\u0430\u043b\u0438\u0441\u044c, \u0430 \u043c\u043d\u0435 \u043d\u0443\u0436\u043d\u043e \u0431\u044b\u043b\u043e, \u0447\u0442\u043e\u0431\u044b \u043f\u0435\u0440\u0432\u044b\u0439 \u043f\u043e\u0434 \u0437\u0430\u043f\u0438\u0441\u0430\u043b \u0434\u0430\u043d\u043d\u044b\u0435, \u0430 \u043f\u043e\u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u0447\u0438\u0442\u0430\u043b\u0438 \u0438\u0445. \u042f \u043d\u0430\u0447\u0430\u043b \u0438\u0441\u043a\u0430\u0442\u044c, \u043a\u0430\u043a \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u043a\u0430\u0441\u0442\u043e\u043c\u043d\u044b\u0439 \u043a\u0435\u0448-\u0445\u0435\u043d\u0434\u043b\u0435\u0440, \u043d\u043e \u0433\u043e\u0442\u043e\u0432\u044b\u0445 \u0440\u0435\u0448\u0435\u043d\u0438\u0439 \u043d\u0435 \u043d\u0430\u0448\u0451\u043b.      \u042f \u043d\u0430\u0448\u0451\u043b \u0432 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438 Next.js \u0443\u043f\u043e\u043c\u0438\u043d\u0430\u043d\u0438\u0435 \u043e \u043a\u0430\u0441\u0442\u043e\u043c\u043d\u044b\u0445 \u043a\u0435\u0448-\u0445\u0435\u043d\u0434\u043b\u0435\u0440\u0430\u0445 (\u0432\u043e\u0442 \u0441\u0441\u044b\u043b\u043a\u0430), \u043d\u043e \u0442\u0430\u043c \u043f\u043e\u043a\u0430\u0437\u0430\u043d \u0442\u043e\u043b\u044c\u043a\u043e \u043c\u0438\u043d\u0438\u043c\u0430\u043b\u044c\u043d\u044b\u0439 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 \u043a\u0435\u0448-\u0445\u0435\u043d\u0434\u043b\u0435\u0440\u0430, \u0431\u0435\u0437 \u0434\u0435\u0442\u0430\u043b\u0435\u0439 \u043f\u0440\u043e shared storage, \u0438\u043d\u0432\u0430\u043b\u0438\u0434\u0430\u0446\u0438\u044e \u0438 \u043a\u043e\u043d\u043a\u0443\u0440\u0435\u043d\u0446\u0438\u044e \u0447\u0442\u0435\u043d\u0438\u044f\/\u0437\u0430\u043f\u0438\u0441\u0438 \u0438 \u043d\u0435 \u0431\u044b\u043b\u043e \u043f\u0440\u0438\u043c\u0435\u0440\u0430, \u043a\u0430\u043a \u044d\u0442\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0441 PVC. \u0420\u0430\u0437\u0431\u0438\u0440\u0430\u044f\u0441\u044c, \u044f \u043f\u043e\u043d\u044f\u043b, \u0447\u0442\u043e \u0443 \u043a\u0435\u0448-\u0445\u0435\u043d\u0434\u043b\u0435\u0440\u0430 \u0435\u0441\u0442\u044c \u043a\u043b\u044e\u0447\u0435\u0432\u044b\u0435 \u043c\u0435\u0442\u043e\u0434\u044b. set &#8212; \u043e\u0442\u0432\u0435\u0447\u0430\u0435\u0442 \u0437\u0430 \u0441\u043e\u0445\u0440\u0430\u043d\u0435\u043d\u0438\u0435 \u0434\u0430\u043d\u043d\u044b\u0445, get &#8212; \u0437\u0430 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u0435, \u0430 revalidateTag &#8212; \u043e\u0431\u043d\u043e\u0432\u043b\u044f\u0435\u0442 \u0434\u0430\u043d\u043d\u044b\u0435 \u043f\u043e \u0442\u0435\u0433\u0430\u043c.  \u0414\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u043e\u0431\u0449\u0438\u043c \u0445\u0440\u0430\u043d\u0438\u043b\u0438\u0449\u0435\u043c \u043c\u043d\u0435 \u0442\u0430\u043a\u0436\u0435 \u043f\u0440\u0438\u0448\u043b\u043e\u0441\u044c \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e \u043f\u0440\u043e\u0434\u0443\u043c\u0430\u0442\u044c \u0441\u0435\u0440\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044e \u0438 \u0434\u0435\u0441\u0435\u0440\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044e \u0437\u0430\u043f\u0438\u0441\u0435\u0439 \u043d\u0430 \u0441\u0442\u043e\u0440\u043e\u043d\u0435 Node.js. \u042f \u0441\u043e\u0437\u0434\u0430\u043b \u0445\u0440\u0430\u043d\u0438\u043b\u0438\u0449\u0435 \u043d\u0430 PVC, \u0433\u0434\u0435 \u0437\u0430\u043f\u0438\u0441\u044b\u0432\u0430\u043b \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u044b, \u0430 \u043f\u043e\u0434\u044b \u0437\u0430\u0442\u0435\u043c \u0447\u0438\u0442\u0430\u043b\u0438 \u0434\u0430\u043d\u043d\u044b\u0435 \u043e\u0442\u0442\u0443\u0434\u0430. \u0422\u0430\u043a \u044f \u043f\u043e\u043b\u0443\u0447\u0438\u043b \u0446\u0435\u043d\u0442\u0440\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u043d\u043e\u0435 \u043a\u0435\u0448\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435.  \u0412\u043e\u0442 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u043a\u0435\u0448-\u0445\u0435\u043d\u0434\u043b\u0435\u0440\u0430 \u0438\u0437 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438:const cacheHandler = {  async get(cacheKey, softTags) {    const entry = cache.get(cacheKey)    if (!entry) return undefined     \/\/ Check if expired    const now = Date.now()    if (now &gt; entry.timestamp + entry.revalidate * 1000) {      return undefined    }     return entry  },    async set(cacheKey, pendingEntry) {    \/\/ Wait for the entry to be ready    const entry = await pendingEntry     \/\/ Store in your cache system    cache.set(cacheKey, entry)  },}      \u0418\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f Node.js, \u044f \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043b \u043c\u0435\u0442\u043e\u0434 set, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u043e\u0434\u0433\u043e\u0442\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u0442 \u0437\u0430\u043f\u0438\u0441\u044c, \u0432\u044b\u0447\u0438\u0441\u043b\u044f\u0435\u0442 \u0441\u0440\u043e\u043a \u0435\u0451 \u0430\u043a\u0442\u0443\u0430\u043b\u044c\u043d\u043e\u0441\u0442\u0438 \u0438 \u0441\u043e\u0445\u0440\u0430\u043d\u044f\u0435\u0442 \u0434\u0430\u043d\u043d\u044b\u0435 \u0432 \u043e\u0431\u0449\u0435\u043c \u0432\u043d\u0435\u0448\u043d\u0435\u043c \u0445\u0440\u0430\u043d\u0438\u043b\u0438\u0449\u0435: \u041d\u0438\u0436\u0435 \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d\u044b \u0443\u043f\u0440\u043e\u0449\u0451\u043d\u043d\u044b\u0435 \u0438 \u043e\u0431\u0435\u0437\u043b\u0438\u0447\u0435\u043d\u043d\u044b\u0435 \u0444\u0440\u0430\u0433\u043c\u0435\u043d\u0442\u044b \u043a\u043e\u0434\u0430. \u041e\u043d\u0438 \u043f\u0435\u0440\u0435\u0434\u0430\u044e\u0442 \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u0443 \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u0438 \u043a\u043b\u044e\u0447\u0435\u0432\u044b\u0435 \u0438\u0434\u0435\u0438, \u043d\u043e \u043d\u0435 \u043f\u043e\u0432\u0442\u043e\u0440\u044f\u044e\u0442 \u043f\u0440\u043e\u0434\u043e\u0432\u0443\u044e \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044e \u043e\u0434\u0438\u043d \u0432 \u043e\u0434\u0438\u043d.  async set(key, data, ctx) {  if (this.isBuildPhase || !this.storageUrl) {    return;  }  await this.initPromise;  const existingRequest = this.pendingWrites.get(key);  if (existingRequest) {    return existingRequest;  }  const entryKey = getEntryKey(key);  const request = (async () =&gt; {    try {      if (data == null) {        await storage.remove(entryKey);        return;      }      const revalidateSec = extractRevalidateSeconds(data, ctx);      const tags = parseTagsFrom(data, ctx);      const ttl = revalidateSec &gt; 0 ? revalidateSec : DEFAULT_TTL_SEC;      const now = Date.now();      const entry = {        value: data,        modifiedAt: now,        tags,        revalidateSec: ttl,        expiresAt: now + ttl * 1000,      };      await storage.write(entryKey, encodeEntry(entry), ttl);      await this.touchEntry(entryKey);      await this.evictIfNeeded();    } catch (error) {      console.error(&#8216;[CacheHandler] Failed to write cache entry&#8217;, error);    } finally {      this.pendingWrites.delete(key);    }  })();  this.pendingWrites.set(key, request);  return request;} \u041c\u0435\u0442\u043e\u0434 get \u0447\u0438\u0442\u0430\u0435\u0442 \u0437\u0430\u043f\u0438\u0441\u044c \u0438\u0437 \u0432\u043d\u0435\u0448\u043d\u0435\u0433\u043e \u0445\u0440\u0430\u043d\u0438\u043b\u0438\u0449\u0430, \u0434\u0435\u043a\u043e\u0434\u0438\u0440\u0443\u0435\u0442 \u0435\u0451 \u0438 \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u0442, \u043d\u0435 \u0443\u0441\u0442\u0430\u0440\u0435\u043b\u0430 \u043b\u0438 \u043e\u043d\u0430 \u043f\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u0438\u043b\u0438 \u043f\u043e \u0442\u0435\u0433\u0430\u043c: async get(key) {  if (this.isBuildPhase || !this.storageUrl) {    return null;  }  await this.initPromise;  const existingRequest = this.pendingReads.get(key);  if (existingRequest) {    return existingRequest;  }  const entryKey = getEntryKey(key);  const request = (async () =&gt; {    try {      const storage = await this.initPromise;      const rawValue = await storage.read(entryKey);      if (!rawValue) {        return null;      }      let entry;      try {        entry = decodeEntry(rawValue);      } catch (error) {        console.error(&#8216;[CacheHandler] Failed to decode cache entry&#8217;, error);        await storage.remove(entryKey);        return null;      }      if (        typeof entry?.expiresAt === &#8216;number&#8217; &amp;&amp;        entry.expiresAt &gt; 0 &amp;&amp;        entry.expiresAt &lt;= Date.now()      ) {        await storage.remove(entryKey);        return null;      }      if (        entry?.tags?.length &amp;&amp;        await this.isEntryStaleByTags(entry.tags, entry.modifiedAt)      ) {        await storage.remove(entryKey);        return null;      }      await this.touchEntry(entryKey);      return entry;    } catch (error) {      console.error(&#8216;[CacheHandler] Failed to read cache entry&#8217;, error);      return null;    } finally {      this.pendingReads.delete(key);    }  })();  this.pendingReads.set(key, request);  return request;} \u041c\u0435\u0442\u043e\u0434 revalidateTag \u043d\u0435 \u0443\u0434\u0430\u043b\u044f\u0435\u0442 \u0437\u0430\u043f\u0438\u0441\u044c \u043d\u0430\u043f\u0440\u044f\u043c\u0443\u044e, \u0430 \u043f\u043e\u043c\u0435\u0447\u0430\u0435\u0442 \u0441\u0432\u044f\u0437\u0430\u043d\u043d\u044b\u0435 \u0442\u0435\u0433\u0438 \u043a\u0430\u043a \u0438\u043d\u0432\u0430\u043b\u0438\u0434\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0435. \u0411\u043b\u0430\u0433\u043e\u0434\u0430\u0440\u044f \u044d\u0442\u043e\u043c\u0443 \u043f\u0440\u0438 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u043c \u0447\u0442\u0435\u043d\u0438\u0438 \u0443\u0441\u0442\u0430\u0440\u0435\u0432\u0448\u0430\u044f \u0437\u0430\u043f\u0438\u0441\u044c \u0431\u0443\u0434\u0435\u0442 \u043e\u0442\u0431\u0440\u043e\u0448\u0435\u043d\u0430 \u0438 \u043f\u0435\u0440\u0435\u0441\u043e\u0431\u0440\u0430\u043d\u0430 \u0437\u0430\u043d\u043e\u0432\u043e: async revalidateTag(tags) {  if (this.isBuildPhase || !this.storageUrl) {    return;  }  await this.initPromise;  const tagsList = Array.isArray(tags) ? tags : [tags].filter(Boolean);  if (!tagsList.length) {    return;  }  const invalidatedAt = Date.now();  await storage.markTagsInvalid(tagsList, invalidatedAt);}\u0422\u0430\u043a \u0448\u0430\u0433 \u0437\u0430 \u0448\u0430\u0433\u043e\u043c \u044f \u043f\u043e\u0441\u0442\u0440\u043e\u0438\u043b \u043a\u0430\u0441\u0442\u043e\u043c\u043d\u044b\u0439 \u043f\u043e\u0434\u0445\u043e\u0434, \u0438\u043d\u0442\u0435\u0433\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u0441 PVC.      \u041a\u043e\u0433\u0434\u0430 \u044f \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u044b\u0432\u0430\u043b \u043a\u0430\u0441\u0442\u043e\u043c\u043d\u044b\u0439 \u043a\u0435\u0448-\u0445\u0435\u043d\u0434\u043b\u0435\u0440 \u043d\u0430 PVC, \u0443 \u043c\u0435\u043d\u044f \u0432\u043e\u0437\u043d\u0438\u043a\u043b\u0438 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b. PVC \u043c\u0435\u0434\u043b\u0435\u043d\u043d\u0435\u0435 \u043f\u0430\u043c\u044f\u0442\u0438, \u0438 \u043d\u0443\u0436\u043d\u043e \u0431\u044b\u043b\u043e \u0438\u0437\u0431\u0435\u0433\u0430\u0442\u044c \u0433\u043e\u043d\u043a\u0438. \u0412\u043e-\u043f\u0435\u0440\u0432\u044b\u0445, \u044f \u0440\u0435\u0448\u0430\u043b \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0443 \u0443\u0441\u0442\u0430\u0440\u0435\u0432\u0448\u0438\u0445 \u0434\u0430\u043d\u043d\u044b\u0445 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0444\u0443\u043d\u043a\u0446\u0438\u0438 isEntryStaleByTags:async isEntryStaleByTags(tags, modifiedAt) {  if (!tags.length) {    return false;  }  const invalidatedAt = await storage.getTagsInvalidationTime(tags);  return invalidatedAt &gt; modifiedAt;} \u0412\u043e-\u0432\u0442\u043e\u0440\u044b\u0445, \u044f \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0438\u0432\u0430\u043b \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0437\u0430\u043f\u0438\u0441\u0435\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u0435\u0439  evictIfNeeded  :async evictIfNeeded() {  const overflow = await storage.getOverflowCount();  if (overflow &lt;= 0) {    return;  }  const staleEntries = await storage.getLeastRecentlyUsed(overflow);  await storage.removeEntries(staleEntries);}\u0412-\u0442\u0440\u0435\u0442\u044c\u0438\u0445, \u044f \u0433\u0430\u0440\u0430\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u043b, \u0447\u0442\u043e \u043f\u0440\u0438 \u0437\u0430\u043f\u0438\u0441\u0438 \u043c\u044b \u0430\u043a\u043a\u0443\u0440\u0430\u0442\u043d\u043e \u043e\u0431\u043d\u043e\u0432\u043b\u044f\u0435\u043c \u0438\u043d\u0434\u0435\u043a\u0441 (\u043f\u0440\u0438 \u043a\u0430\u0436\u0434\u043e\u043c \u0447\u0442\u0435\u043d\u0438\u0438 \u0438\u043b\u0438 \u0437\u0430\u043f\u0438\u0441\u0438 \u044f \u043e\u0431\u043d\u043e\u0432\u043b\u044f\u044e \u0438\u043d\u0434\u0435\u043a\u0441 \u0430\u043a\u0442\u0438\u0432\u043d\u043e\u0441\u0442\u0438 \u0437\u0430\u043f\u0438\u0441\u0438, \u0447\u0442\u043e\u0431\u044b \u043c\u043e\u0436\u043d\u043e \u0431\u044b\u043b\u043e \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0438\u0432\u0430\u0442\u044c \u0440\u0430\u0437\u043c\u0435\u0440 \u043a\u0435\u0448\u0430) \u0447\u0435\u0440\u0435\u0437 touchEntry:   async touchEntry(entryKey) {    await storage.touchIndex(entryKey, Date.now());  }\u042d\u0442\u0438 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0432\u043c\u0435\u0441\u0442\u0435 \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0438\u043b\u0438 \u0430\u043a\u0442\u0443\u0430\u043b\u044c\u043d\u043e\u0441\u0442\u044c, \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u0435 \u0438 \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u043a\u0435\u0448\u0430. \u041e\u0442\u0434\u0435\u043b\u044c\u043d\u043e\u0439 \u0437\u0430\u0434\u0430\u0447\u0435\u0439 \u043e\u043a\u0430\u0437\u0430\u043b\u0441\u044f \u0441\u0431\u0440\u043e\u0441 \u043a\u0435\u0448\u0430. \u0412 \u043a\u0430\u043a\u043e\u0439-\u0442\u043e \u043c\u043e\u043c\u0435\u043d\u0442 \u044f \u043f\u043e\u043f\u0440\u043e\u0431\u043e\u0432\u0430\u043b \u0441\u0445\u0435\u043c\u0443 \u0441 L1-\u043a\u0435\u0448\u0435\u043c \u043d\u0430 \u043a\u0430\u0436\u0434\u043e\u043c \u043f\u043e\u0434\u0435: \u043a\u0430\u0436\u0434\u044b\u0439 \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0434\u0435\u0440\u0436\u0430\u043b \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u044b\u0439 \u0433\u043e\u0440\u044f\u0447\u0438\u0439 \u043a\u0435\u0448, \u0430 \u0434\u043b\u044f \u0441\u0438\u043d\u0445\u0440\u043e\u043d\u0438\u0437\u0430\u0446\u0438\u0438 \u0438\u043d\u0432\u0430\u043b\u0438\u0434\u0430\u0446\u0438\u0438 \u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b \u0432\u043d\u0435\u0448\u043d\u0438\u0439 \u0441\u0438\u0433\u043d\u0430\u043b \u0447\u0435\u0440\u0435\u0437 Redis. \u041d\u0430 \u043f\u0440\u0430\u043a\u0442\u0438\u043a\u0435 \u044d\u0442\u043e \u043e\u043a\u0430\u0437\u0430\u043b\u043e\u0441\u044c \u0441\u043b\u0438\u0448\u043a\u043e\u043c \u0441\u043b\u043e\u0436\u043d\u044b\u043c. \u041a\u0430\u0436\u0434\u044b\u0439 \u043f\u043e\u0434 \u0434\u043e\u043b\u0436\u0435\u043d \u0431\u044b\u043b \u043e\u0442\u0441\u043b\u0435\u0436\u0438\u0432\u0430\u0442\u044c \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u0432\u043e \u0432\u043d\u0435\u0448\u043d\u0435\u043c \u0441\u043b\u043e\u0435, \u0432\u043e\u0432\u0440\u0435\u043c\u044f \u043f\u043e\u043d\u0438\u043c\u0430\u0442\u044c, \u0447\u0442\u043e \u0434\u0430\u043d\u043d\u044b\u0435 \u0443\u0441\u0442\u0430\u0440\u0435\u043b\u0438, \u0438 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e \u0441\u0431\u0440\u0430\u0441\u044b\u0432\u0430\u0442\u044c \u0441\u0432\u043e\u0439 \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u044b\u0439 L1-\u043a\u0435\u0448. \u0427\u0435\u043c \u0431\u043e\u043b\u044c\u0448\u0435 \u043f\u043e\u0434\u043e\u0432 \u0441\u0442\u0430\u043d\u043e\u0432\u0438\u043b\u043e\u0441\u044c \u0432 \u0441\u0438\u0441\u0442\u0435\u043c\u0435, \u0442\u0435\u043c \u043c\u0435\u043d\u0435\u0435 \u0443\u0434\u043e\u0431\u043d\u043e\u0439 \u0438 \u043f\u0440\u0435\u0434\u0441\u043a\u0430\u0437\u0443\u0435\u043c\u043e\u0439 \u0432\u044b\u0433\u043b\u044f\u0434\u0435\u043b\u0430 \u0442\u0430\u043a\u0430\u044f \u0441\u0445\u0435\u043c\u0430.\u0412 \u0438\u0442\u043e\u0433\u0435 \u043c\u044b \u043e\u0442\u043a\u0430\u0437\u0430\u043b\u0438\u0441\u044c \u043e\u0442 \u0438\u0434\u0435\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c Redis \u043a\u0430\u043a \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u0435 \u0438\u043b\u0438 \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0438\u0440\u0443\u044e\u0449\u0435\u0435 \u0445\u0440\u0430\u043d\u0438\u043b\u0438\u0449\u0435 \u0434\u043b\u044f \u0432\u0441\u0435\u0433\u043e \u043a\u0435\u0448\u0430. \u0412\u043c\u0435\u0441\u0442\u043e \u044d\u0442\u043e\u0433\u043e Redis \u043e\u0441\u0442\u0430\u043b\u0441\u044f \u0442\u043e\u043b\u044c\u043a\u043e \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u0438\u043c \u0431\u044b\u0441\u0442\u0440\u044b\u043c L1-\u0441\u043b\u043e\u0435\u043c \u0434\u043b\u044f \u0441\u0430\u043c\u044b\u0445 \u0433\u043e\u0440\u044f\u0447\u0438\u0445 \u0437\u0430\u043f\u0438\u0441\u0435\u0439 &#8212; \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0434\u043b\u044f \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0435\u0439 \u0442\u044b\u0441\u044f\u0447\u0438 \u043d\u0430\u0438\u0431\u043e\u043b\u0435\u0435 \u043f\u043e\u0441\u0435\u0449\u0430\u0435\u043c\u044b\u0445 \u0441\u0442\u0440\u0430\u043d\u0438\u0446. \u0412\u0441\u0451 \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u043e\u0435 \u043f\u0440\u043e\u0434\u043e\u043b\u0436\u0438\u043b\u043e \u0445\u0440\u0430\u043d\u0438\u0442\u044c\u0441\u044f \u0432 PVC \u043a\u0430\u043a \u0432 \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u043c \u043e\u0431\u0449\u0435\u043c \u0445\u0440\u0430\u043d\u0438\u043b\u0438\u0449\u0435. \u0422\u0430\u043a\u043e\u0439 \u043f\u043e\u0434\u0445\u043e\u0434 \u043f\u043e\u0437\u0432\u043e\u043b\u0438\u043b \u043d\u0435 \u0440\u0430\u0437\u0434\u0443\u0432\u0430\u0442\u044c \u043f\u043e\u0442\u0440\u0435\u0431\u043b\u0435\u043d\u0438\u0435 \u043e\u043f\u0435\u0440\u0430\u0442\u0438\u0432\u043d\u043e\u0439 \u043f\u0430\u043c\u044f\u0442\u0438, \u043d\u043e \u043f\u0440\u0438 \u044d\u0442\u043e\u043c \u0441\u043e\u0445\u0440\u0430\u043d\u0438\u0442\u044c \u0431\u044b\u0441\u0442\u0440\u044b\u0439 \u0434\u043e\u0441\u0442\u0443\u043f \u043a \u0441\u0430\u043c\u043e\u0439 \u0430\u043a\u0442\u0443\u0430\u043b\u044c\u043d\u043e\u0439 \u0447\u0430\u0441\u0442\u0438 \u043a\u0435\u0448\u0430. \u041a\u0440\u043e\u043c\u0435 \u0442\u043e\u0433\u043e, \u043f\u0440\u0438 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0438 \u043a\u0430\u0441\u0442\u043e\u043c\u043d\u043e\u0433\u043e \u043a\u0435\u0448-\u0445\u0435\u043d\u0434\u043b\u0435\u0440\u0430 \u044f \u0434\u043e\u0431\u0430\u0432\u0438\u043b \u0435\u0433\u043e \u0432 \u0444\u0438\u043d\u0430\u043b\u044c\u043d\u044b\u0439 runtime-\u043e\u0431\u0440\u0430\u0437 \u043d\u0430 \u044d\u0442\u0430\u043f\u0435 \u0441\u0431\u043e\u0440\u043a\u0438.  COPY &#8212;from=builder \/workspace\/custom-cache-handler.js .\/custom-cache-handler.js  \u0412 next.config.ts \u044f \u0434\u043e\u0431\u0430\u0432\u0438\u043b \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044e, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442 \u043f\u0443\u0442\u044c \u043a \u043a\u0430\u0441\u0442\u043e\u043c\u043d\u043e\u043c\u0443 \u043a\u0435\u0448-\u0445\u0435\u043d\u0434\u043b\u0435\u0440\u0443 \u0447\u0435\u0440\u0435\u0437 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u044f. \u0417\u0430\u043e\u0434\u043d\u043e \u044f \u043e\u0442\u043a\u043b\u044e\u0447\u0438\u043b \u0432\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u044b\u0439 in-memory-\u043a\u0435\u0448, \u0447\u0442\u043e\u0431\u044b \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u043d\u0435 \u0440\u0430\u0441\u0445\u043e\u0434\u043e\u0432\u0430\u043b\u043e \u043b\u0438\u0448\u043d\u044e\u044e \u043f\u0430\u043c\u044f\u0442\u044c \u043f\u043e\u0432\u0435\u0440\u0445 \u0432\u043d\u0435\u0448\u043d\u0435\u0433\u043e \u0445\u0440\u0430\u043d\u0438\u043b\u0438\u0449\u0430.  cacheHandler: process.env.HANDLER_PATH    ? path.resolve(process.env.HANDLER_PATH)    : undefined,  cacheMaxMemorySize: 0\u0422\u0430\u043a \u044f \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u043b \u043a\u0430\u0441\u0442\u043e\u043c\u043d\u044b\u0439 \u043a\u0435\u0448\u2011\u0445\u0435\u043d\u0434\u043b\u0435\u0440 \u043a\u00a0Next.js, \u043e\u0442\u043a\u043b\u044e\u0447\u0438\u043b \u0432\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u044b\u0439 in\u2011memory\u2011\u043a\u044d\u0448 \u0438 \u043f\u043e\u043b\u0443\u0447\u0438\u043b \u043f\u0440\u0435\u0434\u0441\u043a\u0430\u0437\u0443\u0435\u043c\u0443\u044e \u0441\u0445\u0435\u043c\u0443 \u043a\u044d\u0448\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0432\u00a0\u043c\u043d\u043e\u0433\u043e\u043f\u043e\u0434\u043e\u0432\u043e\u043c \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u0438 \u0441\u00a0\u043e\u0431\u0449\u0438\u043c PVC. \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 https:\/\/habr.com\/ru\/articles\/1028314\/<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-477522","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/477522","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=477522"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/477522\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=477522"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=477522"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=477522"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}