Title: Headers
Last modified: August 21, 2016

---

# Headers

 *  Resolved [barthat](https://wordpress.org/support/users/barthat/)
 * (@barthat)
 * [12 years, 11 months ago](https://wordpress.org/support/topic/headers-9/)
 * 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/](http://wordpress.org/plugins/autoptimize/)

Viewing 2 replies - 1 through 2 (of 2 total)

 *  Plugin Author [Frank Goossens](https://wordpress.org/support/users/futtta/)
 * (@futtta)
 * [12 years, 11 months ago](https://wordpress.org/support/topic/headers-9/#post-4059858)
 * 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](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
 *  Thread Starter [barthat](https://wordpress.org/support/users/barthat/)
 * (@barthat)
 * [12 years, 11 months ago](https://wordpress.org/support/topic/headers-9/#post-4059870)
 * 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>
       ```
   

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Headers’ is closed to new replies.

 * ![](https://ps.w.org/autoptimize/assets/icon-256X256.png?rev=2211608)
 * [Autoptimize](https://wordpress.org/plugins/autoptimize/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/autoptimize/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/autoptimize/)
 * [Active Topics](https://wordpress.org/support/plugin/autoptimize/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/autoptimize/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/autoptimize/reviews/)

## Tags

 * [headers](https://wordpress.org/support/topic-tag/headers/)

 * 2 replies
 * 2 participants
 * Last reply from: [barthat](https://wordpress.org/support/users/barthat/)
 * Last activity: [12 years, 11 months ago](https://wordpress.org/support/topic/headers-9/#post-4059870)
 * Status: resolved