Forums

Batcache ignores content type header, sends everything as text/html (2 posts)

  1. misterbisson
    Member
    Posted 7 months ago #

    Any content that's cached by batcache gets re-sent with a text/html content-type header, regardless of the original header.

    Note the header given here (a live site using Batcache):
    http://collingswoodlib.org/index.php?bsuite_mycss=print

    Despite the explicit text/css header being specified here:
    http://plugins.trac.wordpress.org/browser/bsuite/trunk/bsuite.php#L963

    I've confirmed this with other content served through Batcache, including things like this image:
    http://collingswoodlib.org/files/2008/11/cropped-collingswood2.jpg

    http://wordpress.org/extend/plugins/batcache/

  2. misterbisson
    Member
    Posted 7 months ago #

    It looks like apache_response_headers() isn't returning the content-type header, but headers_list() does.

    I've solved the problem by changing these lines:

    if ( function_exists( 'apache_response_headers' ) ) {
    	$cache['headers'] = apache_response_headers();

    To something like this:

    if ( function_exists( 'headers_list' ) ) {
    	$cache['headers'] = headers_list();

Reply

You must log in to post.

About this Topic