You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by System Support <su...@MicroTechniques.com> on 2007/03/23 15:36:22 UTC

mime-types

Randomly the mime-type of my .css files changes from text/css to 
text/plain. 

Immediately after a restart, the mime-type is sent correctly.  I used 
Rex Swain's HTTP Viewer to inspect the headers, and immediately after a 
reset I see:

Content-Type: text/css

If I wait awhile and reload the page, I see:

Content-Type: text/plain; charset=UTF-8

The pages are not displayed correctly by the browser.

Googling I get a huge number of hits, but the vast majority are about 
misconfigurations, where the server never sends the correct mime-type.  
Since this works correctly after a restart, I do not believe that it is 
a configuration error.  However, I have checked the configuration 
carefully and even added a .htaccess with an AddType text/css .css

There were a number of php and tiki forums discussing identical 
problems, but there were never any resolutions - the problems just 
mysteriously went away or the posters gave up.

There were a couple of similar bugs reported against caching, but they 
are shown as being fixed.  I did try disabling caching, but it did not 
seem to help.

I did recently add charset=utf-8 to the content-type meta tag of the 
index page. Removing it did not seem to help 

I am running Apache/2.0.59 on SuSE linux 10.2.

The css is included with:

<link href="myfile.css" rel="stylesheet" type="text/css" />

the DOCTYPE is xhtml1-strict

-------

Output from Rex Swain's HTTP Viewer :

After restart of the Apache server:

HTTP/1.1·200·OK(CR)(LF)
Date:·Fri,·23·Mar·2007·14:01:13·GMT(CR)(LF)
Server:·Apache/2.0.59·(Unix)·mod_ssl/2.0.59·OpenSSL/0.9.8d·PHP/51.4·Mo
d_Rexx/2.1.0(CR)(LF)
Last-Modified:·Thu,·22·Mar·2007·15:43:12·GMT(CR)(LF)
ETag:·"12c5dca-ed3-cbe52400"(CR)(LF)
Accept-Ranges:·bytes(CR)(LF)
Content-Length:·3795(CR)(LF)
Cache-Control:·max-age=604800(CR)(LF)
Expires:·Fri,·30·Mar·2007·14:01:13·GMT(CR)(LF)
MTSpecial:·D=796·t=1174658473821118(CR)(LF)
Connection:·close(CR)(LF)
Content-Type:·text/css(CR)(LF)
Content-Language:·en(CR)(LF)
(CR)(LF)


After reloading page:


HTTP/1.1·200·OK(CR)(LF)
Date:·Fri,·23·Mar·2007·14:02:04·GMT(CR)(LF)
Server:·Apache/2.0.59·(Unix)·mod_ssl/2.0.59·OpenSSL/0.9.8d·PHP/51.4·Mo
d_Rexx/2.1.0(CR)(LF)
Content-Type:·text/plain;·charset=UTF-8(CR)(LF)
Last-Modified:·Thu,·22·Mar·2007·15:43:12·GMT(CR)(LF)
ETag:·"12c5dca-ed3-cbe52400"(CR)(LF)
Accept-Ranges:·bytes(CR)(LF)
Content-Length:·3795(CR)(LF)
Cache-Control:·max-age=604800(CR)(LF)
Expires:·Fri,·30·Mar·2007·14:01:13·GMT(CR)(LF)
Age:·50(CR)(LF)
MTSpecial:·D=124·t=1174658524001488(CR)(LF)
Connection:·close(CR)(LF)
(CR)(LF)

----

I note that the Content-Type has moved, the charset has been appended, 
and the Content-Language has been dropped

As an unexplicable note, the Content-Type header displays correctly if 
inspected with WANNA Browser.


HTTP/1.1 200 OK
Date: Fri, 23 Mar 2007 14:19:23 GMT
Server: Apache/2.0.59 (Unix) mod_ssl/2.0.59 OpenSSL/0.9.8d PHP/5.1.4 
Mod_Rexx/2.1.0
Last-Modified: Thu, 22 Mar 2007 15:43:12 GMT
ETag: "12c5dca-ed3-cbe52400"
Accept-Ranges: bytes
Content-Length: 3795
Cache-Control: max-age=604800
Expires: Fri, 30 Mar 2007 14:19:23 GMT
MTSpecial: D=197 t=1174659563564311
Content-Type: text/css
Content-Language: en


I ran the pages through the W3 validation server and corrected all of 
the errors and warnings.  

I am at a complete loss.


..don

support (at) microtechniques.com



Re: mime-types and caching

Posted by System Support <su...@MicroTechniques.com>.

On 23 Mar 2007 at 11:14, Joshua Slive wrote:

> On 3/23/07, System Support <su...@microtechniques.com> wrote:
> > Randomly the mime-type of my .css files changes from text/css to
> > text/plain.
> 
> > There were a couple of similar bugs reported against caching, but they
> > are shown as being fixed.  I did try disabling caching, but it did not
> > seem to help.

 
> But certainly, notwithstanding your comment above, caching is the most
> likely culprit here. If you are using caching, you should certainly
> upgrade to version 2.2. (And even in 2.2, mod_disk_cache seems quite a
> bit more stable than mod_mem_cache.)
> 
> Joshua.

'Would like to use 2.2 but a couple of my more important scripts throw 
addressing exceptions in 2.2 when running an external app.  They work 
fine in 2.0.  It is a very low priority for the vendor to investigate.

I revisited the caching.  I had disabled it by commenting out the 
CacheEnable in the vhost of the site I was testing.  I retested and 
commented out the CacheEnable's in all of the other vhost files, not 
just the one with the problem, and that seems to have helped.


Thanks Joshua,

..don

support (at) microtechniques.com



Re: mime-types

Posted by Joshua Slive <jo...@slive.ca>.
On 3/23/07, System Support <su...@microtechniques.com> wrote:
> Randomly the mime-type of my .css files changes from text/css to
> text/plain.

> There were a couple of similar bugs reported against caching, but they
> are shown as being fixed.  I did try disabling caching, but it did not
> seem to help.

I don't see why you are starting this discussion here rather than on
the users list.

But certainly, notwithstanding your comment above, caching is the most
likely culprit here. If you are using caching, you should certainly
upgrade to version 2.2. (And even in 2.2, mod_disk_cache seems quite a
bit more stable than mod_mem_cache.)

Joshua.