Just updated my Node.js and Express versions to 0.10.21 and 3.4.4, respectively, and now I'm seeing some weird view caching in development (and production).
It seems the html generated from views included within other views (or maybe all views?) is being cached.
For example:
layout.jade
doctype 5
html
head
title= title
meta(name="viewport", content="width=device-width, initial-scale=1.0")
link(rel='stylesheet', href='/stylesheets/style.css')
body
#container
include header
block content
include footer
header.jade
- var headerClass = ""
if pageVars.headerOverBackground
- headerClass = "overbackground"
#header(class=headerClass)
[snip]
somepage.jade
extends layout
block content
[snip]
The first time I call /somepage, passing pageVars.headerOverBackground set to true, the view is rendered correctly. If I visit a different URL, /someotherpage, with the same layout and header, passing in pageVars.headerOverBackground set to false, I still see the header.jade portion rendered as if it was on the previous page (with the "overbackground" class on #header), as if pageVars.headerOverBackground is still true.
But it's false, and I've got the console.log()'s to prove it.
Am I doing something wrong? Am I just horribly confused? I've run Node in development and production modes and even peppered my Express with
app.disable('view cache');
to no avail...
edit:
No matter how many times I reload the page, it loads the cached view. If I restart Node and reload, the correct view appears.