Closed guillemc23 closed 1 year ago
this example is old and should be updated, sorry about that
Hello Vincent, thank you for your fast response. I will test this soon and check if everything is working as expected.
So far I have noticed we're still missing from typing import Optional
but looks good 😉
Hello again Vincent, the cache is working, but when an item is cached, it's returning a Starlette response object as in <starlette.responses.Response object at 0x7fc64bfd3850>
that can't be understood by the browser nor Postman. media_type
looks correct.
I think I'm missing something. Could you point me towards the right direction?
When loading a resource for the first time, works like a charm 😄
@guillemc23 when I tried yesterday locally it seemed to work 🤷 I won't have time right now to check this 🙁
@vincentsarago I wasn't able to make it work, I think there was something wrong with the deserializer. But I found another Python library which is newer and, according to the maintainers, faster than aiocache
. It works with memory or redis and solves this issue mentioned in the docs:
Because aiocache.cached doesn't support non-async method we have to create a custom cached class
So it reduces the amount of code and it's much easier to set up 😄
If you're interested I can PR with the solution I found with this new library.
If you're interested I can PR with the solution I found with this new library.
🙏 yes that would be lovely
@vincentsarago I confirm this is still the case. There's an issue in the serialization, the object is serialized as its string representation. So technically it's not a titiler issue be the recipe in the doc is broken.
@guillemc23 would you be available to share your approach with cashews?
Hey! I'm trying to add cache to my Titiler instance, but I bumped into this line while following the docs.
https://github.com/developmentseed/titiler/blob/27b4972f21b245a4ca6bfcffae369a30e1171d0b/docs/src/examples/code/tiler_with_cache.md?plain=1#L169
In this line, it's trying to import
MetadataParams
(which is not used anywhere on the rest of the code, so I guess it should be removes) andTMSParams
. Both of this names result in errors when importing as in:I am unable to find any reference to any of those dependencies in the official documentation. Were they moved/refactored/deprecated? How should I proceed to configuring Titiler with cache?
I'm running Titiler on a docker image from
ghcr.io/developmentseed/titiler:latest
.Thank you!