Closed sfabijanski closed 5 years ago
@sfabijanski - thanks for adding this. Cool idea. If you are up for submitting a PR to koop-core I would happily review.
Also note that every provider can define it's own createKey
function to allow for customization of the keys. Simply add it to your Model.prototype
as shown here and it will override the internal createKey function for that provider.
@rgwozdz Thanks. I'll try to get a PR in place soon. I missed the email notification on your reply, else I would have responded sooner.
Added and released in Koop 3.13.0.
While following suggestions in #302 to handle different datasets in the getData method for a provider by branching on different layer indices, I discovered the caching mechanism only allows one cache instance per provider. I dug in a little bit and in the createKey method in model.js I can see the cache key is derived by pulling the name of the provider based on the URL root from the provider such that any request pulls from a single cache despite a different layer ID.
I'm suggesting to add the layer ID to the cache key to enable multiple cache keys on a single provider. I'm not sure if handling of multiple layers is a supported aproach, but if so, something like this should allow multiple caches to be employed as well.