header(“Content-type: text/css”); is working in Firefox and Chrome, but in Internet Explorer 9 it shows up as 'text/html'

前端 未结 8 1053
时光取名叫无心
时光取名叫无心 2020-12-01 09:12

header(\"Content-type: text/css\"); works in Firefox, Chrome and other, but not in Internet Explorer 9. I am not sure what\'s up.

In Chrome an

8条回答
  •  天命终不由人
    2020-12-01 09:46

    IE has "No, I'm not kidding about Content-Type" switch:

    X-Content-Type-Options: nosniff
    

    BTW: make sure you also send Last-Modified and disable session.cache_limiter in PHP, otherwise browsers will keep reloading the CSS file, which will negatively impact performance.

提交回复
热议问题