WordPress.org

Ready to get started?Download WordPress

Forums

Autoptimize
[resolved] Headers (3 posts)

  1. barthat
    Member
    Posted 11 months ago #

    I currently have multiple Cache-Control directives in my headers.

    HTTP/1.1 200 OK
        Server: cloudflare-nginx
        Date: Fri, 23 Aug 2013 14:00:13 GMT
        Content-Type: text/css; charset=utf-8
        Transfer-Encoding: chunked
        Connection: keep-alive
        Set-Cookie: __cfduid=d9875e4c85f50153f1327d57ba3dcc6181377266412900;
            expires=Mon, 23-Dec-2019 23:50:00 GMT; path=/;
            domain=.xxxxxxxx.com
        Vary: Accept-Encoding,Cookie
        Cache-Control: max-age=30672000, public, must-revalidate
        Expires: Wed, 13 Aug 2014 14:00:12 GMT
        Last-Modified: Fri, 23 Aug 2013 10:18:55 GMT
        X-UA-Compatible: IE=edge
        Cache-Control: private, no-store, no-cache, must-revalidate, no-transform,
            max-age=0
        CF-RAY: a2853e8a3cc3112
        Content-Encoding: gzip

    and REDbot is throwing up errors / warnings on the autoptize generated php files....

    The ETag header's syntax isn't valid.
    The max-age Cache-Control directive appears more than once.

    Note: I am also using WP-Supercache, I have cache-control and expiry directives in my htaccess, and I am using Cloudflare.

    What headers does Autoptimze add and do you have any advice on changes I should make?

    http://wordpress.org/plugins/autoptimize/

  2. Frank Goossens
    Member
    Plugin Author

    Posted 11 months ago #

    the versions pre-1.6.0 had an max-age that was too long. the current code does this (cfr. http://plugins.svn.wordpress.org/autoptimize/trunk/config/delayed.php);

    $expireTime=60*60*24*355; // 1y max according to RFC
    header('Cache-Control: max-age='.$expireTime.', public, must-revalidate');
    header('Expires: '.gmdate('D, d M Y H:i:s', time() + $expireTime).' GMT');
    header('Last-Modified: '.gmdate('D, d M Y H:i:s', $modTime).' GMT');

    hope this helps,
    frank

  3. barthat
    Member
    Posted 11 months ago #

    Yes, That was helpful thanks.

    I still don't understand why I get "The ETag header's syntax isn't valid." for this header Last-Modified: Fri, 23 Aug 2013 10:18:55 GMT.

    I fixed my other headers issues with this

    <FilesMatch "^autoptimize_.*\.php$">
    	Header unset Cache-Control
    	Header merge Cache-Control "proxy-revalidate"
    	</FilesMatch>

Reply

You must log in to post.

About this Plugin

About this Topic

Tags