You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
My application has a /[lang]/[location] route. While [lang]/index.tsx is using getStaticPaths and uses fallback: false, [lang]/[location].tsx is returning an paths: [] in getStaticPaths and using fallback: true, because of large count of locations.
Crawlers for spam and security issues are probing different paths, like /wp-includes/wlwmanifest.xml. While /wp-includes returns an 404 error and will be not cached (.next/server/static/[ID]/pages), the request /wp-includes/wlwmanifest.xml will return an 200 status code (despite I'm returning <Error statusCode={404} /> if the location doesn't exist) and the request will be cached. This caching leads to an ever increasing size of .next/server/static/[ID]/pages.
Any idea how to fix the wrong status code and prevent caching of invalid pages, without setting to fallback: false and pre-render everything at deployment?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
My application has a
/[lang]/[location]
route. While[lang]/index.tsx
is usinggetStaticPaths
and usesfallback: false
,[lang]/[location].tsx
is returning anpaths: []
ingetStaticPaths
and usingfallback: true
, because of large count of locations.Crawlers for spam and security issues are probing different paths, like
/wp-includes/wlwmanifest.xml
. While/wp-includes
returns an 404 error and will be not cached (.next/server/static/[ID]/pages
), the request/wp-includes/wlwmanifest.xml
will return an 200 status code (despite I'm returning<Error statusCode={404} />
if the location doesn't exist) and the request will be cached. This caching leads to an ever increasing size of.next/server/static/[ID]/pages
.Any idea how to fix the wrong status code and prevent caching of invalid pages, without setting to
fallback: false
and pre-render everything at deployment?Beta Was this translation helpful? Give feedback.
All reactions