You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I think the resolver should be responsible for determining whether and how an annotation resource is cached, rather than this being baked into the AnnotationResource.
E.g. we currently have:
def read(self):
""" Read the contents of the Annotation Resource
:return: the contents of the resource
:rtype: str or bytes or flask.response
"""
if not self.__content__:
self.__retriever__ = self.__resolver__.resolve(self.uri)
self.__content__, self.__mimetype__ = self.__retriever__.read(self.uri)
return self.__content__
This is problematic in a variety of ways ...
the memory consumption could get quite huge as all annotation resources will be cached in memory after first read
if the annotation resource itself is not static, such as might be the case with a remote resource served via HTTP, there is no way for it to be refreshed
Probably the resolver should be configured with a cache provider, and it should be up to the resolver to figure out when to refresh the cache (e.g. for an http retriever via cache headers, for a local resource by date/timestamp/file size, etc.)
The text was updated successfully, but these errors were encountered:
Agree with the general idea, resolver should have the ability to get a Cache instance fed up to them on instantiation. Great idea.
As for the RAM issue, it is not totally correct. What you describes is the case in a non quite developy environment, where there is one thread which never sleeps. Basically, bad configs (heroku) or flask default .run(). I do not think this holds true for balanced / right envs
I think the resolver should be responsible for determining whether and how an annotation resource is cached, rather than this being baked into the AnnotationResource.
E.g. we currently have:
This is problematic in a variety of ways ...
Probably the resolver should be configured with a cache provider, and it should be up to the resolver to figure out when to refresh the cache (e.g. for an http retriever via cache headers, for a local resource by date/timestamp/file size, etc.)
The text was updated successfully, but these errors were encountered: