Page 1 of 1

404 pages

PostPosted: August 18th, 2010, 2:19 pm
by dozarte
Could be nice if the plugin could recognize the errors on a page (404, 500, etc.) and queue them to re-built its cache.
...no?
;)

Re: 404 pages

PostPosted: August 24th, 2010, 9:23 am
by Jason Caldwell
Thanks for the great suggestion.
One important thing to consider is that a 404 error is usually NOT a good reason to serve a non-cached page, or to rebuild the cache. For instance, if WordPress is hit by a spider/crawler that is looking for non-existent pages, you would not want your WordPress installation to get pounded, and given the current Quick Cache configuration, it would not be. I'll take another look at this before the next release though, and see if we can provide some additional options on the back-end, so that a site owner can choose for themselves.

I realize that some site owners would prefer NOT to cache 404's at all. So it makes sense to have an option for this.

Re: 404 pages

PostPosted: August 24th, 2010, 9:45 am
by dozarte
You are right: it's good to cache a non existing page as an error page.

The problem is bigger on errors like "server down", "error connecting to database", and so on...
These errors are temporary, so it's a big mess if a page is cached as 'error page'.

That's why I think could be nice if the plugin could recognize these kind of erros, and queue the pages to re-cache.

BYE!

Re: 404 pages

PostPosted: August 24th, 2010, 10:06 am
by Jason Caldwell
Gotchya. Thanks for reporting back on this.

@C/TODO :: add support for 5xx error codes, instead of just a subset of 50x.

Re: 404 pages

PostPosted: September 14th, 2010, 10:47 am
by dozarte
I've done a 50 $ donation...
If it worths, I'd really like you to add support for errors.
;)
Thanks anyway!

Re: 404 pages

PostPosted: September 29th, 2010, 10:38 am
by Jason Caldwell
@COMPLETED/TODO :: add support for 5xx error codes, instead of just a subset of 50x.
This was added in Quick Cache version 2.2.5. ( to be released shortly )
~ Thank you.

Re: 404 pages

PostPosted: September 29th, 2010, 11:13 am
by dozarte
I can hardly wait to see it in action!

Re: 404 pages

PostPosted: September 29th, 2010, 11:33 am
by Jason Caldwell
Thanks for the follow up. Version 2.2.5 is now available.
Please feel free to offer feedback.

Re: 404 pages

PostPosted: October 1st, 2010, 1:26 am
by dozarte
Is there a new panel or it's all "inside"?

Re: 404 pages

PostPosted: October 2nd, 2010, 12:36 pm
by Jason Caldwell
Yes, that's correct. Quick Cache deals with error codes dynamically. Any status code that begins with 5 will be excluded from the cache automatically, as it should be. If you'd like to see how it works, you can have a look inside: /quick-cache/includes/functions/status-headers.inc.php
Code: Select all
/*
This function monitors status header codes.
Attach to: add_filter("status_header");
*/
if (!function_exists ("ws_plugin__qcache_status"))
    {
        function ws_plugin__qcache_status ($header = FALSE, $status = FALSE)
            {
                $GLOBALS["QUICK_CACHE_STATUS"] = $status;
                /**/
                return $header;
            }
    } 

There is also a new snippet inside: /wp-content/advanced-cache.php
Code: Select all
if (preg_match ("/^5/", $GLOBALS["QUICK_CACHE_STATUS"]))
return $buffer; /* Do NOT cache. */ 
Reflected inside: /quick-cache/includes/templates/handler.txt

Re: 404 pages

PostPosted: October 3rd, 2010, 12:53 am
by dozarte
Great job mr. Caldwell!
That was my big problem with your good plugin.
Now... no more!
:)
PS: Since I'm using "Custom Admin Branding" plugin on clients' sites I did not see "clear cache" button on every page of admin area, but only on Quck Cache Config Option page; it seems that now - after upgrade - it's disappeared even from there...

Re: 404 pages

PostPosted: October 15th, 2010, 8:09 am
by dozarte
Jason Caldwell wrote:Thanks for the follow up. Version 2.2.5 is now available.
Please feel free to offer feedback.


Hello Jason,
I'm not sure this new feature works well...

Here is the html code of a wrongly cached page:

Code: Select all
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>Database Error</title>
</head>
<body>
    <h1>Error establishing a database connection</h1>
</body>
</html>
<!-- This Quick Cache file was built for (  www.libridaleggere.org/libri/la-casa-di-ghiaccio-venti-piccole-storie-russe/ ) in 5.01560 seconds, on Oct 15th, 2010 at 11:58 am UTC. -->
<!-- This Quick Cache file will automatically expire ( and be re-built automatically ) on Oct 27th, 2010 at 1:45 am UTC -->
<!-- +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
<!-- Quick Cache Is Fully Functional :-) ... A Quick Cache file was just served for (  www.libridaleggere.org/libri/la-casa-di-ghiaccio-venti-piccole-storie-russe/ ) in 0.00055 seconds, on Oct 15th, 2010 at 1:04 pm UTC. -->

Does Quick Cache consider these type of errors now?
Or not yet?

Re: 404 pages

PostPosted: October 16th, 2010, 3:12 pm
by Jason Caldwell
Thanks for reporting back on this topic.

This bug has been addressed in the release of Quick Cache v2.2.6.

== Changelog ==

= 2.2.6 =
* Updated to disable caching on database failures that do not trigger a `5xx` error code. Quick Cache is now capable of disabling the cache engine dynamically on all database connection failures within WordPress®.