• Hello,

    Using the wordpress plugin WP-FFPC plugin. Seems to be working to certain extent but am seeing some errors when its caching.

    PHP Warning: file_get_contents(https://blog.something.com/funny/): failed to open stream: HTTP request failed! HTTP/1.1 404 Not Found

    Seems to be picking up posts thats no longer exisit or have been changed as its caching the correct one.

    https://blog.something.com/category/funny/   0.21   21.46

    how would I stop / remove WP-FFPC from trying to cache these as they no longer there 🙂

    Thanks in advance

    https://wordpress.org/plugins/wp-ffpc/

Viewing 10 replies - 1 through 10 (of 10 total)
  • Plugin Author petermolnar

    (@cadeyrn)

    Hi,

    That is most probably not the plugins fault but WordPress itself.
    This is the code what lists the urls to be pre-cached:

    /* get all published posts */
    $args = array (
    	'post_type' => 'any',
    	'posts_per_page' => -1,
    	'post_status' => 'publish',
    );
    $posts = new WP_Query( $args );
    
    /* get all the posts, one by one  */
    while ( $posts->have_posts() ) {
    	$posts->the_post();
    
    	/* get the permalink for currently selected post */
    	switch ($post->post_type) {
    		case 'revision':
    		case 'nav_menu_item':
    			break;
    		case 'page':
    			$permalink = get_page_link( $post->ID );
    			break;
    		case 'post':
    			$permalink = get_permalink( $post->ID );
    			break;
    		case 'attachment':
    			$permalink = get_attachment_link( $post->ID );
    			break;
    		default:
    			$permalink = get_post_permalink( $post->ID );
    		break;
    	}
    
    	/* in case the bloglinks are relative links add the base url, site specific */
    	$baseurl = empty( $url ) ? PluginUtils::_site_url() : $url;
    	if ( !strstr( $permalink, $baseurl ) ) {
    		$permalink = $baseurl . $permalink;
    	}
    
    	/* collect permalinks */
    	$links[ $permalink ] = true;
    
    }

    as you can see it uses the built-in options WordPress provides.

    Is the post in the thrash or is it fully deleted?

    Thread Starter stevetoza

    (@stevetoza)

    Hello,

    The posts have been fully removed from the trash also.

    Plugin Author petermolnar

    (@cadeyrn)

    Are you using any kind of persistent object cache?
    Could a MySQL query cache be involved?

    Thread Starter stevetoza

    (@stevetoza)

    Hi Peter,

    Nothing at all, no MySQL query cache being used either.

    Plugin Author petermolnar

    (@cadeyrn)

    I honestly have no idea why this is happening.
    Could you please try to query the db directly to see if the post is there or not or has any clues?

    Thread Starter stevetoza

    (@stevetoza)

    I shall have a look at doing that later on 🙂

    I have another site aswell when the pluggin is enabled, If you go to the website its just a white page.

    In the logs for the cache I see

    PHP Warning:  file_get_contents(http://blog.example.com/business-structures-2/): failed to open stream: HTTP request failed! HTTP/1.1 500 Internal Server Error
     in /tmp/wp-ffpc-precache.php on line 97

    In ther PHP-FPM log I see

    PHP Warning:  Invalid argument supplied for foreach() in     /home/nginx/domains/blog.example.com/public/wp-content/themes/jeffsrowe/Flavour/class-flavour-helpers.php on line 14
    
    PHP Fatal error:  Call to a member function get() on a non-object in /home/nginx/domains/blog.example.com/public/wp-includes/cache.php on line 113
    Plugin Author petermolnar

    (@cadeyrn)

    this last error seems to be an issue with the theme that’s trying to utilize the wordpress internal cache functions.

    Thread Starter stevetoza

    (@stevetoza)

    Ok, theres no other cache features enabled / plugin.

    Plugin Author petermolnar

    (@cadeyrn)

    wordpress has it’s own cache layer, which can be enabled by define(‘WP_CACHE’, true) in wp-config.

    If they are not checking for this in the theme and trying to use the cache_set/get/etc functions, this might result the error, but this is my opinion, since I don’t know the actual code.

    Thread Starter stevetoza

    (@stevetoza)

    I see, anyway you could take a look ?

Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘WP-FFPC trying to cache content that no longer exisits’ is closed to new replies.