WordPress.org

Ready to get started?Download WordPress

Forums

[Plugin: WP Super Cache] Caches 404 pages incorrectly (7 posts)

  1. AshleyK
    Member
    Posted 6 years ago #

    WP Super Cache returns the wrong header for cached 404 pages.

    Non-cached:

    ash@ash-workstation:~$ curl -I http://blog.ash.ms/404page
    HTTP/1.1 404 Not Found
    Date: Sat, 03 May 2008 07:43:36 GMT
    [...]

    Moments later:

    ash@ash-workstation:~$ curl -I http://blog.ash.ms/404page
    HTTP/1.1 200 OK
    Date: Sat, 03 May 2008 07:43:39 GMT
    [...]

    This is a serious issue, as search engines respond strangely to these pages. Setting the status to "half on" bypasses the super-cache, and fixes the problem.

  2. Donncha O Caoimh
    Member
    Posted 6 years ago #

    Thanks AshleyK for reporting that. Shouldn't be too hard to fix - the plugin will have to avoid caching 404 pages. I thought there was a check for that already in there but I must be wrong.

  3. Donncha O Caoimh
    Member
    Posted 6 years ago #

    Hmm, there is a call to is_404() in the ob_callback function. 404 pages shouldn't be cached at all!

  4. Donncha O Caoimh
    Member
    Posted 6 years ago #

    I just tested on my two main blogs at http://ocaoimh.ie/ and http://inphotos.org/ and neither produced a cached 404 file. Perhaps it's something to do with your theme?

  5. AshleyK
    Member
    Posted 6 years ago #

    That's very strange. I'm getting this issue on two independent themes. I'm pretty sure I'm using the default Kubrick 404 file on the one I posted initially.

    I'll do some investigating and get back to you. :-)

  6. AshleyK
    Member
    Posted 6 years ago #

    Yep, I'm definitely using the default 404 page. Is there anything you can recommend I do?

    I've checked out wp-content/cache/supercache, and it's creating the directory "404page", but there's nothing in it.

    The reason I concluded that it must be super-cache is because after clearing the cache, the initial dead page returns a 404 header, and then subsequent views return 200 Ok. As stated previously, "half on" or "off" fix this.

    My 404.php:

    <?php get_header(); ?>
    
    	<div id="content" class="narrowcolumn">
    
    		<h2 class="center">Error 404 - Not Found</h2>
    
    	</div>
    
    <?php get_sidebar(); ?>
    
    <?php get_footer(); ?>
  7. lxg
    Member
    Posted 6 years ago #

    Just to support Ashley a bit ... ;) The same problem with SuperCache occurs at a customer of mine.

Topic Closed

This topic has been closed to new replies.

About this Topic