# HG changeset patch # User Goffi # Date 1516867200 -3600 # Node ID cdf0ebed9db772193cf1b9a0f8e1ae1dce756805 # Parent d3ac6fb10fd51d6c9284ed8820a14d5d5612db37 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) diff -r d3ac6fb10fd5 -r cdf0ebed9db7 src/server/pages.py --- 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