boldenamsterdam / htmlcache

Cache pages to HTML and boost website performance on Craft CMS 3
MIT License
31 stars 21 forks source link

Page loads entirely blank after cache has expired #8

Closed JamesToothill closed 5 years ago

JamesToothill commented 5 years ago

I'm having a recurring issue where the page will load a blank white screen once the page has reached the cache expiration time.

Appears to be fixed by doing the following (apologies, I don't have permission to push up a branch):

In HtmlcacheService.php:

Line 258 becomes:

\Craft::$app->response->data = file_get_contents($file);
return true;

Line 63 - 65 becomes:

// load cache - may return false if cache has expired
if ($this->loadCache($file)) {
    return \Craft::$app->end();
}

Feel free to add me as a contributor and I'll push these changes into a pull request if that is easier.

Thanks,

boldenamsterdam commented 5 years ago

Hi James,

Looks like a valid improvement. Please fork the project and make a pull request. Then I can approve it.

Thanks!