WordPress.org

Ready to get started?Download WordPress

Forums

W3 Total Cache
Minify removes newlines inside CDATA (7 posts)

  1. niska
    Member
    Posted 3 years ago #

    I've enabled HTML minify. Normally it works fine. But I have a RSS-feed with CDATA. The RSS-feed is located at http://www.mydomain.com/?my_rss

    W3 Total Cache removes newlines inside the CDATA in this RSS-feed.

    I've tried enabling "Don't minify feeds". And I've also disabled "Line break removal". But none of this actions is helping. The newlines are removed anyway.

    If I disable "HTML Minify settings" the newlines are kept. But I want to use minify for my normal HTML, CSS, and JS-pages. What should I do?

  2. Frederick Townes
    Member
    Plugin Author

    Posted 3 years ago #

    Please try the development version available here on wordpress.org.

  3. niska
    Member
    Posted 3 years ago #

    I've tried it now. It still removes newlines.

    I've enabled "Don't minify feeds"
    I've disabled "Line break removal"

    As before: When unchecking the "Enable" checkbox the linebreaks are there.

  4. Frederick Townes
    Member
    Plugin Author

    Posted 3 years ago #

    How is that RSS feed implemented?

  5. niska
    Member
    Posted 3 years ago #

    This is how the feed is created. I've validated the feed - and I have several followers.

    The problem is that W3TC doesn't understand that this is a feed.

    function makerss () {
    	if (isset($_REQUEST['my_rss'])) {
    		require_once(dirname(__FILE__) . '/FeedCreator-1.8.0-dev/feedcreator.class.php');
                    header('Content-type: text/xml; charset=utf-8');
                    $rss = new UniversalFeedCreator();
    		$rss->setEncoding("utf-8");
                    // fill rss with content
                    echo $rss->createFeed("RSS2.0");
    		exit;
    	}
    	// else ignore - normal page
    }
    
    add_action('init', 'makerss');
  6. niska
    Member
    Posted 3 years ago #

    How does W3TC recoqnize RSS-feeds? Maby I can add something to my output?

  7. Frederick Townes
    Member
    Plugin Author

    Posted 3 years ago #

    Unfortunately there are several ways to create a feed, but that implementation isn't what I would call "native", so W3TC sees that as a page if it catches it at all.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic