diff --git a/code/staticpublisher/FilesystemPublisher.php b/code/staticpublisher/FilesystemPublisher.php index b00f4169..e1d78e72 100644 --- a/code/staticpublisher/FilesystemPublisher.php +++ b/code/staticpublisher/FilesystemPublisher.php @@ -191,10 +191,11 @@ class FilesystemPublisher extends StaticPublisher { Requirements::clear(); - - singleton('DataObject')->flushCache(); + //skip any responses with a 404 status code. We don't want to turn those into statically cached pages + if (!$response || $response->getStatusCode() == '404') continue; + // Generate file content // PHP file caching will generate a simple script from a template if($this->fileExtension == 'php') {