Re: Simulation of mime types?

From: Alex Rousskov <rousskov_at_measurement-factory.com>
Date: Mon, 26 Jan 2004 10:07:19 -0700 (MST)

On Sat, 24 Jan 2004, Daniel Barron wrote:

> what is the mime type set for each of these? Looking at contents.pg
> I find:
>
> Content cntImage = {
> kind = "image";
> mime = { type = undef(); extensions = [ ".gif", ".jpeg", ".png" ]; };
> obj_life_cycle = olcImage;
> size = exp(4.5KB);
> cachable = 80%;
> checksum = 1%;
> };
>
> That suggests the mime type is not set so what would it appear to
> the proxy as?

Mime type description is relayed via the Content-Type HTTP header
field. If Content.mime.type is not set (i.e., is undefined in PGL),
then no Content-Type HTTP header field is sent for that content.

In the absence of a Content-Type HTTP header field, some proxies may
try to guess the type based on URL and/or content.

> The reason I ask is I want to test a proxy that deals with different
> mime types differently.
>
> Should I do something like:
>
> mime = { type = "text/html"; extensions = [ ".html" : 60%, ".htm" ]; };

Yes, you can. However, please keep in mind that default Polygraph
content is semi-random text. If you want response content to match the
advertized MIME type and/or URL extension, you need to configure the
Content Simulation Module (CSM) accordingly:
        http://www.web-polygraph.org/docs/userman/csm/

HTH,

Alex.
Received on Mon Jan 26 2004 - 11:07:08 MST

This archive was generated by hypermail 2.2.0 : Wed Dec 03 2008 - 12:00:08 MST