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

Cache not working? #6758

Closed
PPBWoodBoy opened this issue Jun 25, 2023 · 4 comments
Closed

Cache not working? #6758

PPBWoodBoy opened this issue Jun 25, 2023 · 4 comments
Labels
question The issue is a question. Please use Stack Overflow for questions.

Comments

@PPBWoodBoy
Copy link

Hi,

I´m using Cube Core (Docker) in the version: 0.32.2 in dev mode.

I´m logging the querys and durations that cube is sending to my postgres db.

Now heres the question:
The Documentation for Cube says that the Devmode in Cube Core uses "in-memory" caching
but still Cube sends a query to my postgres db everytime I rerun the actual report (in developer playground).

Do I need to configure or activate the in-memory caching first?

Best regards.

@PPBWoodBoy PPBWoodBoy added the question The issue is a question. Please use Stack Overflow for questions. label Jun 25, 2023
@paveltiunov
Copy link
Member

@PPBWoodBoy For Postgres by default, it refreshes every 10 seconds. Please see https://cube.dev/docs/schema/reference/cube#parameters-refresh-key.

@PPBWoodBoy
Copy link
Author

@PPBWoodBoy For Postgres by default, it refreshes every 10 seconds. Please see https://cube.dev/docs/schema/reference/cube#parameters-refresh-key.

Ok thank you, that means that I have to increase the refresh_key to a higher number like 10 minutes or something like that?

@PPBWoodBoy
Copy link
Author

Is the cache active even if I dont have configured any refreshKey in my JS schema?

@igorlukanin
Copy link
Member

Ok thank you, that means that I have to increase the refresh_key to a higher number like 10 minutes or something like that?

Yes, you can do that. Alternatively, you can set up pre-aggregations and skip querying the database at all.

Is the cache active even if I dont have configured any refreshKey in my JS schema?

If you skip the refresh key, the default value will be used.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question The issue is a question. Please use Stack Overflow for questions.
Projects
None yet
Development

No branches or pull requests

3 participants