--- /dev/null
+use warnings;
+use strict;
+use Test::More;
+use App::SCS;
+use IO::All;
+
+use File::Tempdir;
+
+my $tmpdir = File::Tempdir->new();
+my $dir = io($tmpdir->name);
+
+$dir->catdir('share/pages/cachetest')->mkpath;
+$dir->catdir('share/templates')->mkpath;
+
+io('t/data/cachetest/share/pages/cachetest/1.html') > io($dir->catfile('share/pages/cachetest/1.html'));
+io('t/data/cachetest/share/pages/cachetest.conf') > io($dir->catfile('share/pages/cachetest.conf'));
+io('t/data/cachetest/share/templates/layout.html') > io($dir->catfile('share/templates/layout.html'));
+io('t/data/cachetest/share/templates/alternate.html') > io($dir->catfile('share/templates/alternate.html'));
+io('t/data/cachetest/share/templates/third.html') > io($dir->catfile('share/templates/third.html'));
+
+my $app = App::SCS->new(
+ root_dir => $dir
+);
+
+my $cachetest1 = $app->pages->get({ path => 'cachetest/1' });
+
+ok($cachetest1, 'Got a page object');
+
+is(
+ $cachetest1->html,
+ io->file('t/data/cachetest/share/pages/cachetest/1.html')->all,
+ "Correct file loaded"
+);
+
+like ($cachetest1->_html_zoom->to_html,
+ qr{<body>.*<h2>Heading 2</h2>.*</body>}s,
+ 'First layout used'
+);
+
+# We want to make sure our config is newer than the cached version
+sleep 1;
+
+io('t/data/cachetest/share/pages/cachetest2.conf') > io($dir->catfile('share/pages/cachetest.conf'));
+
+$cachetest1 = $app->pages->get({ path => 'cachetest/1' });
+
+like ($cachetest1->_html_zoom->to_html,
+ qr{<body>.*<h3>Heading 3</h3>.*</body>}s,
+ 'Changing the config invalidates cache, updates content'
+);
+
+done_testing;