mirror of
https://github.com/GitbookIO/gitbook.git
synced 2026-09-17 16:15:22 +00:00
Fix new cache on Cloudflare (#29)
* Try with next.revalidate = 0 * Remove log * Format
This commit is contained in:
+4
-1
@@ -68,7 +68,10 @@ export const getPublishedContentByUrl = cache(
|
||||
secure: false,
|
||||
format: 'json',
|
||||
signal: signal,
|
||||
cache: 'no-store',
|
||||
// Cloudflare doesn't support the `cache` directive before next-on-pages patches the fetch function
|
||||
// https://github.com/cloudflare/workerd/issues/698
|
||||
// cache: 'no-store',
|
||||
next: { revalidate: 0 },
|
||||
});
|
||||
|
||||
return cacheResponse(response);
|
||||
|
||||
@@ -53,6 +53,7 @@ export async function middleware(request: NextRequest) {
|
||||
console.log(`rendering ${resolved.space} ${resolved.pathname}`);
|
||||
|
||||
const headers = new Headers(request.headers);
|
||||
headers.set('origin', inputURL.origin);
|
||||
headers.set('x-gitbook-token', resolved.apiToken);
|
||||
headers.set('x-gitbook-basepath', joinPath(proxyBasePath, resolved.basePath));
|
||||
if (apiEndpoint) {
|
||||
|
||||
Reference in New Issue
Block a user