From fd5f6a526e1a30125c09611dd897fe54c5583547 Mon Sep 17 00:00:00 2001 From: Adam Rudd Date: Fri, 18 Dec 2015 14:43:22 +0100 Subject: [PATCH 1/2] Use prerender's url, rather than express' This is because prerender does some extra wrangling on the url, removing _escaped_fragment_ and so on --- lib/mongoCache.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/mongoCache.js b/lib/mongoCache.js index 7156d72..53bf972 100644 --- a/lib/mongoCache.js +++ b/lib/mongoCache.js @@ -35,7 +35,7 @@ module.exports = { }, afterPhantomRequest: function(req, res, next) { - this.cache.set(req.url, req.prerender.documentHTML); + this.cache.set(req.prerender.url, req.prerender.documentHTML); next(); } }; From 4a28bf6c11db55e52a3ac40b1f23527e0b94a992 Mon Sep 17 00:00:00 2001 From: Adam Rudd Date: Fri, 18 Dec 2015 15:04:44 +0100 Subject: [PATCH 2/2] Use prerender's url in cache get too --- lib/mongoCache.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/mongoCache.js b/lib/mongoCache.js index 53bf972..4c19a06 100644 --- a/lib/mongoCache.js +++ b/lib/mongoCache.js @@ -25,7 +25,7 @@ module.exports = { return next(); } - this.cache.get(req.url, function (err, result) { + this.cache.get(req.prerender.url, function (err, result) { if (!err && result) { res.send(200, result); } else {