Understanding enableSingleSchemaCache, schemaCacheTTL and cacheTTL

I am trying to get a better understanding of the following options enableSingleSchemaCache, schemaCacheTTL and cacheTTL on parse server. The documentation is fairly sparse but here is my limited (and quite possibly wrong) understanding of these parameters.

Info taken from: https://parseplatform.org/parse-server/api/master/ParseServerOptions.html

enableSingleSchemaCache - This one default to false and I have no idea why it would. My understanding is that the schema definition (list of tables/classes, field definitions, etc) is loaded with every REST API call? This would seem like a huge overhead and I cant imagine why anyone would want this set to FALSE in production.

schemaCacheTTL - This is how long the schema definition (list of tables/classes, field definitions, etc) are stored in memory. The documentation above does say to set this to “a long TTL in production” but I am wondering what values are people using in their production config. Considering I make schema changes once or twice every 2-3 months I would think this should be set to NEVER expire and only expire when I make a structure change to any of the classes/tables.

cacheTTL - I really am not sure about this but I am going to take a guess. When I instantiate an instance of a class the object is cached in memory. So if I instantiate it again, it will be retrieved from memory and not incur a round trip to the the DB (mongo in my case). If that is true, does this cache persist beyond the life of the cloud function? 5 seconds (the default value) doesnt seem like a very useful cache period. What are people setting this to?



1 Like

Great question. Docs for this elements are not enough. Docs says cacheTTL is number. But Is It miliseconds, Minutes, hours? Parse Server Configurations needs to be more clear.

No doubt that the documentation needs to be more clear but what I am hoping to achieve with this post is to share information between us so we know what people are using in their productive systems (and why). For example, I assume most people just use default values but for those that have tweaked the settings, why did they choose X.

By the way I am pretty sure that the cacheTTL is in milliseconds.

So many questions and I hope that people will share their knowledge so that we can all get better at hosting Parse on our servers.

1 Like

@ATrcked If you are interested there is a PR open that is improving (maybe removing) enableSingleSchemaCache

1 Like

Thanks for letting me know