• Hi there,

    My cached, minified an gziped css files are delivered as ‘application/x-trash’ and so not rendered as css file by different browsers (chrome, firefox, safari, …). So the site looks like delivered without a css file.

    Response Header is this:

    Accept-Ranges:bytes
    Cache-Control:max-age=2592000, public, must-revalidate, proxy-revalidate
    Connection:keep-alive, Keep-Alive
    Content-Encoding:gzip
    Content-Length:26693
    Content-Location:567f4.default.include.040b57.css.gzip.old
    Content-Type:application/x-trash
    Date:Mon, 24 Oct 2016 15:26:40 GMT
    ETag:”6845-53f618e8f39f5;53f9dc1024862″
    Expires:Wed, 23 Nov 2016 15:26:40 GMT
    Keep-Alive:timeout=2, max=999
    Last-Modified:Fri, 21 Oct 2016 15:18:39 GMT
    Pragma:public
    Server:Apache
    strict-transport-security:max-age=31536000
    TCN:choice
    Vary:negotiate,accept-encoding
    X-Powered-By:W3 Total Cache/0.9.5.1

    It is since W3TC version 0.9.5.1, I think.

    Only help till now:

    Add to .htaccess file the line: AddType text/css .old
    which is not a true solution, because the javascript files have also the .old file ending.

    Can you help please?

    Best regards
    Holger

Viewing 4 replies - 1 through 4 (of 4 total)
  • Hi Holger,

    We’ve had the same issue in the last few days. Looks like apache is picking up on the ‘.old’ component in the file name (see ‘Content-Location’) and assigning application/x-trash. Apache reads file extensions right to left to assign content type.

    We first noticed it when CSS rules stopped getting applied and we get the console message: “Resource interpreted as Stylesheet but transferred with MIME type application/x-trash: …”

    As a workaround, we’ve added the following rules to the root .htaccess file. Its more surgical than the solution to list above.

    <FilesMatch ".+\.css(\.gzip)?\.old$">
    Header set Content-Type "text/css"
    </FilesMatch>
    
    <FilesMatch ".+\.js(\.gzip)?\.old$">
    Header set Content-Type "application/javascript"
    </FilesMatch>

    I don’t understand why W3 Total Cache are using the .old extension in the first place. It would be good to get their feedback on the issue. We’re on W3TC version 0.9.5.1 also on WP 4.6.1

    Thanks, Josh

    Thread Starter yarishima42

    (@yarishima42)

    Hi Josh,
    Thanks a lot for the snippet. I thought, it was after a W3TC update. But why it doesn’t came up earlier, is not clear. So maybe they anwser this, too.
    Best regards,
    Holger

    Same here. Happens randomly on different WordPress Sites. Thanks for the workarround.

    Same issue, but the workaround didn’t work for me so have disabled CSS minification for now.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Old gziped css files are delivered as ‘application/x-trash’’ is closed to new replies.