PHWinfo banniere

Titres
PORTAIL ANNUAIRE ARTICLES COMPARATEUR HÉBERGEURS DEVIS FORUMS RÉDUCTEUR D'URL
Précédent   PHWinfo > Forums Hébergement > Forum Hébergement serveur > comp.info.servers.unix > content-type versus content-encoding
S'inscrire FAQ Membres Recherche Messages du jour Marquer les forums comme lus
comp.info.servers.unix Web servers for UNIX platforms.

content-type versus content-encoding

Réponse
 
LinkBack Outils de la discussion
Vieux 18/07/2006, 14h40   #1
Alan J. Flavell
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut content-type versus content-encoding


I'm trying to get optimal results for files whatever.ps.gz (to take an
example). If it's relevant, Apache version is 2.0.46-something, as
distributed by RHEL.

What I think I want is for these files to be sent with:

Content-type: application/postscript
Content-encoding: gzip

(or should that still be x-gzip ?)

OK, I went into this thinking that I knew what to do, but soon I was
finding myself at Witt's End.

By default, I found that I was getting:

Content-Type: application/x-gzip
Content-Encoding: x-gzip

Indeed, the x-gzip content-encoding is defined in the main
configuration (default setting of httpd.conf).

I thought maybe I could persuade it to deliver application/postscript
if I used:

RemoveType .gz

in the applicable .htaccess file. Well, the server happily swallowed
the directive, but it made no difference to the content-type being
served out! It was still Content-Type: application/x-gzip

I'm sure that my AllowOverride and such is OK, otherwise the
directives would be rejected as in error, surely?

Then I tried a bit of a web search and found this FAQ:
http://www.math.uwaterloo.ca/mfcf/fa...ures_ps_gz.faq

This suggests e.g:

<Files *.html.gz>
AddEncoding x-gzip .gz
AddType text/html .gz
</Files>

<Files *.ps.gz>
AddEncoding x-gzip .gz
AddType application/postscript .gz
</Files>

and so on. That looks like rather a kludge, but I tried it
and it did what was wanted.

Fine, as far as it goes... But isn't there a more satisfactory way to
configure this, please? It must be a frequently needed feature, no?

thanks

--
  Réponse avec citation
Vieux 18/07/2006, 16h10   #2
Andreas Prilop
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: content-type versus content-encoding

On Tue, 18 Jul 2006, Alan J. Flavell wrote:

> I'm trying to get optimal results for files whatever.ps.gz (to take an
> example). If it's relevant, Apache version is 2.0.46-something, as
> distributed by RHEL.
>
> What I think I want is for these files to be sent with:
>
> Content-type: application/postscript
> Content-encoding: gzip


Is this a change in Apache 2.0? With Apache 1.3.31, I do get

| Content-Type: application/postscript
| Content-Encoding: gzip

without doing anything in my own .htaccess.

> I thought maybe I could persuade it to deliver application/postscript
> if I used:
> RemoveType .gz


How about using some other extension than ".gz"?

  Réponse avec citation
Vieux 18/07/2006, 16h10   #3
Andreas Prilop
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: content-type versus content-encoding

On Tue, 18 Jul 2006, Alan J. Flavell wrote:

> I'm trying to get optimal results for files whatever.ps.gz (to take an
> example). If it's relevant, Apache version is 2.0.46-something, as
> distributed by RHEL.
>
> What I think I want is for these files to be sent with:
>
> Content-type: application/postscript
> Content-encoding: gzip


Is this a change in Apache 2.0? With Apache 1.3.31, I do get

| Content-Type: application/postscript
| Content-Encoding: gzip

without doing anything in my own .htaccess.

> I thought maybe I could persuade it to deliver application/postscript
> if I used:
> RemoveType .gz


How about using some other extension than ".gz"?

  Réponse avec citation
Vieux 18/07/2006, 16h53   #4
Alan J. Flavell
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: content-type versus content-encoding

On Tue, 18 Jul 2006, Andreas Prilop wrote:

> On Tue, 18 Jul 2006, Alan J. Flavell wrote:
>
> > What I think I want is for these files to be sent with:
> >
> > Content-type: application/postscript
> > Content-encoding: gzip

>
> Is this a change in Apache 2.0? With Apache 1.3.31, I do get
>
> | Content-Type: application/postscript
> | Content-Encoding: gzip
>
> without doing anything in my own .htaccess.


I suppose that might explain why I wasn't aware of the problem before
now.

> How about using some other extension than ".gz"?


I'm afraid not. The files already exist in fairly large numbers
under control of another, and the users will expect them to come with
..ps.gz extensions by long-standing custom and convention. It's my job
to make that happen. As I showed, I *do* have a workable answer, even
if it still feels kludgy.

thanks

--

If the crash doesn't occur immediately, the [development] cycle is broken,
and the result is called a release. -- detha, in the monastery.
  Réponse avec citation
Vieux 18/07/2006, 16h53   #5
Alan J. Flavell
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: content-type versus content-encoding

On Tue, 18 Jul 2006, Andreas Prilop wrote:

> On Tue, 18 Jul 2006, Alan J. Flavell wrote:
>
> > What I think I want is for these files to be sent with:
> >
> > Content-type: application/postscript
> > Content-encoding: gzip

>
> Is this a change in Apache 2.0? With Apache 1.3.31, I do get
>
> | Content-Type: application/postscript
> | Content-Encoding: gzip
>
> without doing anything in my own .htaccess.


I suppose that might explain why I wasn't aware of the problem before
now.

> How about using some other extension than ".gz"?


I'm afraid not. The files already exist in fairly large numbers
under control of another, and the users will expect them to come with
..ps.gz extensions by long-standing custom and convention. It's my job
to make that happen. As I showed, I *do* have a workable answer, even
if it still feels kludgy.

thanks

--

If the crash doesn't occur immediately, the [development] cycle is broken,
and the result is called a release. -- detha, in the monastery.
  Réponse avec citation
Vieux 18/07/2006, 17h02   #6
Andreas Prilop
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: content-type versus content-encoding

On Tue, 18 Jul 2006, Alan J. Flavell wrote:

>> Is this a change in Apache 2.0? With Apache 1.3.31, I do get
>>
>> | Content-Type: application/postscript
>> | Content-Encoding: gzip

>
> I suppose that might explain why I wasn't aware of the problem before
> now.


However, in http://www.math.uwaterloo.ca/mfcf/faq/www_author.html
there is no reference to Apache 2.0 - only to Apache 1.3.
Why was the workaround necessary for them?

And what do the Apache docs say?

  Réponse avec citation
Vieux 18/07/2006, 17h31   #7
Nick Kew
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: content-type versus content-encoding

Alan J. Flavell wrote:
> I'm trying to get optimal results for files whatever.ps.gz (to take an
> example). If it's relevant, Apache version is 2.0.46-something, as
> distributed by RHEL.


Does it have a configuration section looking something like

#
# AddType allows you to add to or override the MIME configuration
# file mime.types for specific file types.
#
#AddType application/x-gzip .tgz
#
# AddEncoding allows you to have certain browsers uncompress
# information on the fly. Note: Not all browsers support this.
# Despite the name similarity, the following Add* directives have
# nothing to do with the FancyIndexing customization directives above.
#
#AddEncoding x-compress .Z
#AddEncoding gzip .gz .tgz
#
# If the AddEncoding directives above are commented-out, then you
# probably should define those extensions to indicate media types:
#
AddType application/x-compress .Z
AddType application/x-gzip .gz .tgz

Fixing that should work just fine. A bug report complaining about
silly defaults can't hurt.

--
Nick Kew
  Réponse avec citation
Vieux 18/07/2006, 17h31   #8
Nick Kew
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: content-type versus content-encoding

Alan J. Flavell wrote:
> I'm trying to get optimal results for files whatever.ps.gz (to take an
> example). If it's relevant, Apache version is 2.0.46-something, as
> distributed by RHEL.


Does it have a configuration section looking something like

#
# AddType allows you to add to or override the MIME configuration
# file mime.types for specific file types.
#
#AddType application/x-gzip .tgz
#
# AddEncoding allows you to have certain browsers uncompress
# information on the fly. Note: Not all browsers support this.
# Despite the name similarity, the following Add* directives have
# nothing to do with the FancyIndexing customization directives above.
#
#AddEncoding x-compress .Z
#AddEncoding gzip .gz .tgz
#
# If the AddEncoding directives above are commented-out, then you
# probably should define those extensions to indicate media types:
#
AddType application/x-compress .Z
AddType application/x-gzip .gz .tgz

Fixing that should work just fine. A bug report complaining about
silly defaults can't hurt.

--
Nick Kew
  Réponse avec citation
Vieux 18/07/2006, 18h48   #9
Alan J. Flavell
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: content-type versus content-encoding


  Réponse avec citation
Vieux 18/07/2006, 18h48   #10
Alan J. Flavell
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: content-type versus content-encoding

On Tue, 18 Jul 2006, Nick Kew wrote:

> Alan J. Flavell wrote:
> > I'm trying to get optimal results for files whatever.ps.gz (to
> > take an example). If it's relevant, Apache version is
> > 2.0.46-something, as distributed by RHEL.

>
> Does it have a configuration section looking something like

[...]
> # AddEncoding allows you to have certain browsers uncompress
> # information on the fly. Note: Not all browsers support this.
> # Despite the name similarity, the following Add* directives have
> # nothing to do with the FancyIndexing customization directives above.
> #
> #AddEncoding x-compress .Z
> #AddEncoding gzip .gz .tgz
> #
> # If the AddEncoding directives above are commented-out, then you
> # probably should define those extensions to indicate media types:
> #
> AddType application/x-compress .Z
> AddType application/x-gzip .gz .tgz


Indeed it does. Could I suspect that the "Note: Not all browsers
support this" is now very old, and could more usefully say something
like "Note: a few browsers, by now little-used, don't support this."

But I'm puzzled that the RemoveType directive in the .htaccess didn't
take away the effect of the AddType directive in the main
configuration: the server evidently swallowed it without protest, but
"nothing happened".

> Fixing that should work just fine. A bug report complaining about
> silly defaults can't hurt.


If you mean that this is also the Apache distributed default, then OK.

But if this is some kind of RHEL-tailored httpd.conf, then I have to
admit we are using Scientific Linux, which is a clone of RHEL, meaning
that I have no right to submit bugs to RH.

thanks

By the way, while this topic is active, I seem to recall at least one
browser which, when presented with a file glorp.something.gz to
download, with content-type application/something and content-encoding
gzip, then the browser would dutifully unzip the object and then store
it in a file named, by default, glorp.something.gz

When the file was then presented to the "something" application (I
think it was tar, but I could be wrong), the application said (in
effect) I can't process that, the filename says that it's gzipped, but
I can see that it isn't.

Any chance that someone recognises this effect, and can say whether
the situation has changed? (Just a shot in the dark - I didn't think
it justified starting a new thread.)
  Réponse avec citation
Vieux 18/07/2006, 20h48   #11
Nick Kew
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: content-type versus content-encoding

Alan J. Flavell wrote:

> By the way, while this topic is active, I seem to recall at least one
> browser which, when presented with a file glorp.something.gz to
> download, with content-type application/something and content-encoding
> gzip, then the browser would dutifully unzip the object and then store
> it in a file named, by default, glorp.something.gz
>
> When the file was then presented to the "something" application (I
> think it was tar, but I could be wrong), the application said (in
> effect) I can't process that, the filename says that it's gzipped, but
> I can see that it isn't.


I've definitely encountered that. But I can't remember the
circumstances, and I don't think it was recent. Was it from
the panic days of Netscape?

--
Nick Kew
  Réponse avec citation
Vieux 18/07/2006, 20h48   #12
Nick Kew
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: content-type versus content-encoding

Alan J. Flavell wrote:

> By the way, while this topic is active, I seem to recall at least one
> browser which, when presented with a file glorp.something.gz to
> download, with content-type application/something and content-encoding
> gzip, then the browser would dutifully unzip the object and then store
> it in a file named, by default, glorp.something.gz
>
> When the file was then presented to the "something" application (I
> think it was tar, but I could be wrong), the application said (in
> effect) I can't process that, the filename says that it's gzipped, but
> I can see that it isn't.


I've definitely encountered that. But I can't remember the
circumstances, and I don't think it was recent. Was it from
the panic days of Netscape?

--
Nick Kew
  Réponse avec citation
Réponse


Outils de la discussion

Règles de messages
Vous ne pouvez pas créer de nouvelles discussions
Vous ne pouvez pas envoyer des réponses
Vous ne pouvez pas envoyer des pièces jointes
Vous ne pouvez pas modifier vos messages

Les balises BB sont activées : oui
Les smileys sont activés : oui
La balise [IMG] est activée : oui
Le code HTML peut être employé : non
Trackbacks are oui
Pingbacks are oui
Refbacks are oui


Fuseau horaire GMT +1. Il est actuellement 01h03.


Édité par : vBulletin® version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC5 Tous droits réservés.
Version française #16 par l'association vBulletin francophone
PHWinfo est un site Éducation Sans Frontières ©2000-2008
Ad Management by RedTyger
©Tous droits réservés par les parties respectives
Page generated in 0,41924 seconds with 20 queries