Skip to content

Does the SCHEMA cache actually work? #3663

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

Closed
woodardj opened this issue Mar 23, 2017 · 9 comments
Closed

Does the SCHEMA cache actually work? #3663

woodardj opened this issue Mar 23, 2017 · 9 comments
Labels
type:question Support or code-level question

Comments

@woodardj
Copy link

I've just enabled the RedisCacheAdapter, and by default, it seems to be caching users and roles just fine, and according to the TTL that I've set (on parse-server 2.3.7).

However, the __SCHEMA cache defaults to 5 seconds, which I'm not sure would be of any value. There's this note in the definitions file for the defaults: https://github.com/ParsePlatform/parse-server/blob/2.3.7/src/cli/definitions/parse-server.js#L215

If I set this property as a config when initializing ParseServer via:
schemaCacheTTL: 60 * 1000,

I see the keys accumulating in Redis, but every request appears to generate a new …__ALL_KEYS and …__MAIN_SCHEMA key, each of which contains identical data, rather than using the previously cached value.

Is caching the SCHEMA through the redis adapter working for anyone? What have I missed?

@flovilmart
Copy link
Contributor

Thanks for reporting the issue, do you have an idea how we could write a failing test for that?

@flovilmart
Copy link
Contributor

@woodardj I went back to the CLI options and yes, I believe you missed the enableSingleSchemaCache; without that option, the _schema is called upon every request.

@woodardj
Copy link
Author

Ah, thanks for circling back, @flovilmart — I must have come to a similar conclusion, as I have that enableSingleSchemaCache param in my config. I'd be happy to add this to docs somewhere and issue a PR, but I'm not sure the best place.

@flovilmart
Copy link
Contributor

enableSingleSchemaCache is true in your config?

@woodardj
Copy link
Author

It is, I must have found it digging through source; our cache appears to be behaving as expected now. I probably found it and forgot to post back on this issue.

@flovilmart
Copy link
Contributor

Awesome :) we probably need to document that. Do you want to add a PR on https://github.com/parse-community/docs/blob/gh-pages/_includes/parse-server/cache-adapters.md or another section about using SchemaCache altogether?

@woodardj
Copy link
Author

woodardj commented May 17, 2017 via email

@flovilmart
Copy link
Contributor

flovilmart commented May 17, 2017 via email

@flovilmart
Copy link
Contributor

Closing as not an issue with parse-server

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:question Support or code-level question
Projects
None yet
Development

No branches or pull requests

3 participants