Mercurial > libervia-web
changeset 1052:cdf0ebed9db7
pages (caches): use request.uri to check cache, to avoid using same cache with pages using different parameters (e.g. different MAM filter for pubsub)
author | Goffi <goffi@goffi.org> |
---|---|
date | Thu, 25 Jan 2018 09:00:00 +0100 |
parents | d3ac6fb10fd5 |
children | a54882348ecc |
files | src/server/pages.py |
diffstat | 1 files changed, 2 insertions(+), 6 deletions(-) [+] |
line wrap: on
line diff
--- a/src/server/pages.py Thu Jan 25 08:34:27 2018 +0100 +++ b/src/server/pages.py Thu Jan 25 09:00:00 2018 +0100 @@ -589,10 +589,6 @@ # we are not on the final page, no need to go further return - if request.args: - # TODO: requests with args are not cached for now - return - profile = self.getProfile(request) or C.SERVICE_PROFILE if cache_type == C.CACHE_PUBSUB: @@ -608,7 +604,7 @@ # only service profile is cache for now return try: - cache = self.cache[profile][cache_type][service][node][self] + cache = self.cache[profile][cache_type][service][node][request.uri][self] except KeyError: # no cache yet, let's subscribe to the pubsub node d1 = self.host.bridgeCall('psSubscribe', service.full(), node, {}, profile) @@ -616,7 +612,7 @@ d1.addErrback(self.checkCacheSubscribeEb, service, node) d2 = self.host.bridgeCall('psNodeWatchAdd', service.full(), node, profile) d2.addErrback(self.psNodeWatchAddEb, service, node) - self._do_cache = [self, profile, cache_type, service, node] + self._do_cache = [self, profile, cache_type, service, node, request.uri] # we don't return the Deferreds as it is not needed to wait for # the subscription to continue with page rendering return