Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The request was not cached with FileSystemCacheHandler #1690

Closed
moaabd opened this issue Feb 10, 2024 · 4 comments · Fixed by #1756
Closed

The request was not cached with FileSystemCacheHandler #1690

moaabd opened this issue Feb 10, 2024 · 4 comments · Fixed by #1756
Assignees

Comments

@moaabd
Copy link

moaabd commented Feb 10, 2024

Description

when i use FileSystemCacheHandler and i want to cache a page with path like : /offre-emploi?salary=true.
I have an error Error: 💥 The request was not cached!
It work with simple path like : /offre-emploi but not with query param.

I try to use the default CacheHandler, and it work well.

const fsCacheHandler = new FileSystemCacheHandler({
cacheFolderPath: join(serverDistFolder, '/cache'),

    prerenderedPagesPath: serverDistFolder,
    addPrerenderedPagesToCache: false,
});

const isr = new ISRHandler({
    indexHtml,
    invalidateSecretToken: 'MY_TOKEN', // replace with env secret key ex. process.env.REVALIDATE_SECRET_TOKEN
    enableLogging: true,
    serverDistFolder,
    browserDistFolder,
    buildId: 'test',
    cache: fsCacheHandler,
    bootstrap: AppServerModule,
    commonEngine,skipCachingOnHttpError: false,
});

Expected

the page /offre-emploi?salary=true. must be cached like in InMemoryCacheHandler

Environment

SSR
Node: 20.9.0
Npm: 10.1.0
Angular: 17.0.3
Angular CLI: 17.0.1

Related to Other Issues

Tasks to Resolve This

Notes

@eneajaho eneajaho self-assigned this Feb 13, 2024
@eneajaho
Copy link
Member

Hello,
ISR doesn't support query params for the moment

This is the function that converts your route to filename and it only supports path params.
Can you rename this issue to:
feat: add support for query params in ISR FileSystemCacheHandler
Thanks.

function convertRouteToFileName(route: string): string {

@smartsuhani
Copy link

I've same issue regarding the cache handling, please take a look here, thanks.

@eneajaho
Copy link
Member

eneajaho commented Feb 15, 2024

I've same issue regarding the cache handling, please take a look here, thanks.

Hello @smartsuhani
Are you using the FilesystemCacheHandler? Are you passing query params in the URL? Is this the case?

maxisam added a commit to maxisam/rx-angular that referenced this issue Aug 22, 2024
@maxisam
Copy link
Contributor

maxisam commented Aug 22, 2024

@eneajaho I add a commit to handle this one as well. Basically it just convert ? to "++" , we can use anything we like actually.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants