Add caching
We should add caching to speed up webdav access. Right now I see two places where caching should be implemented:
-
list webdav root: right now for each project name listed one query is send to tgauth. there could be one query to getAllProjects and stored in a lookup table. The response could be cached indefinitely, as its not possible to change project names. On a lookup fail new projects info could be retrieved and stored.
-
list project root or aggregation: triggers right now one query to tgsearch like "listAggregation" which returns all metadata for all listed objects. Afterwards getInfo() is called for each object, which gets the same metadata again. Also tgauth is involved in each request and response time sums up. It would make sense to cache the response of the first listAggregation in a lookup table for each textgrid-uri, to return this from cache on getInfo. This cache should be bound to the sessionID and could have a lifespan of about 5 to 10seconds.
I guess best option would be to use a solution like memcached or redis for this, which implement a TTL for cached entries.