List Info

Thread: max age option




max age option
country flaguser name
Netherlands
2007-12-03 07:16:08
Hi Alvaro,


In read_config_grammer.y I found:

mimetype_options : T_MAX_AGE T_NUMBER
{
           cherokee_mime_entry_set_maxage
(current_mime_entry, $2);
};


Does this need to be set in the mimes.types file? Or
somewhere else? Do
you have an example for this?


Stefan
_______________________________________________
Cherokee mailing list
Cherokeecherokee-project.com
http://cherokee-project.com/cgi-bin/mailman/listinf
o/cherokee

Re: max age option
country flaguser name
Spain
2007-12-03 10:14:57
Stefan de Konink wrote, On 03/12/2007 08:16:

 > In read_config_grammer.y I found:
 >
 > mimetype_options : T_MAX_AGE T_NUMBER
 > {
 >            cherokee_mime_entry_set_maxage
(current_mime_entry, $2);
 > };
 >
 >
 > Does this need to be set in the mimes.types file? Or
somewhere else?
 > Do you have an example for this?

That is something that only works with Cherokee 0.5. We
switched from
using a Cherokee specific mime types file (0.5) to the
system wide
file (0.6), and therefore we lost the ability to specify the
Max Age
header within the file.

I would like to address in 0.6 this right after 0.6.0 is
released.
The idea is to use the Max-Age as a property of directories,
requests
and extensions.

-- 
Greetings, alo.
http://www.alobbs.com
_______________________________________________
Cherokee mailing list
Cherokeecherokee-project.com
http://cherokee-project.com/cgi-bin/mailman/listinf
o/cherokee

Re: Re: max age option
country flaguser name
Spain
2007-12-03 15:27:38
A.D.F. wrote, On 03/12/2007 17:12:
> Alvaro Lopez Ortega wrote:
>> Stefan de Konink wrote, On 03/12/2007 08:16:
>>
>>  > In read_config_grammer.y I found:
>>  >
>>  > mimetype_options : T_MAX_AGE T_NUMBER
>>  > {
>>  >            cherokee_mime_entry_set_maxage
(current_mime_entry, $2);
>>  > };
>>  >
>>  >
>>  > Does this need to be set in the mimes.types
file? Or somewhere else?
>>  > Do you have an example for this?
>>
>> That is something that only works with Cherokee
0.5. We switched from
>> using a Cherokee specific mime types file (0.5) to
the system wide
>> file (0.6), and therefore we lost the ability to
specify the Max Age
>> header within the file.
>>
>> I would like to address in 0.6 this right after
0.6.0 is released.
>> The idea is to use the Max-Age as a property of
directories, requests
>> and extensions.
> 
> Alvaro, do you think it is worthwhile to start by
adding
> a global parameter for the entire server ?
> 
> 	server!max_age = 300
> 
> This could be useful to set a default max-age for the
whole server
> instead of adding it to each mime type that can be
served
> (some web masters like to use a whole machine to serve
>  static files only).
> 
> 
> In the near future we could add it to virtual server
entries too:
> 
> 	vserver!default!max_age = 600
> 
> 
> then to mime types, i.e.:
> 
> 	vserver!default!mime_type!image/jpeg!max_age = 500
> 	vserver!default!mime_type!image/gif!max_age = 800
> 
> 
> and finally to single directories, i.e.:
> 
> 	vserver!default!directory!/images!max_age = 86400
> 
> 
> If you think it is not too odd, max-age could be added
> to mime.types file too (i.e. an extension that does
not
> start with . (i.e. .jpeg, .gif, etc.)
> and it is a number then it is read as a max-age value.
> 
> By this way max-age could be set globally per
mime-type
> at almost no-cost.

My original idea was to integrate it as a property of the
configuration 
entries (directories, extensions and requests). For
instance:

  vserver!default!directory!/icons!max_age = 500

or

  vserver!default!extensions!xml!max_age = 500

What would you think of that?

-- 
Greetings, alo.
http://www.alobbs.com
_______________________________________________
Cherokee mailing list
Cherokeecherokee-project.com
http://cherokee-project.com/cgi-bin/mailman/listinf
o/cherokee

Re: Re: max age option
country flaguser name
Netherlands
2007-12-03 15:41:06
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512

Alvaro Lopez Ortega schreef:
> A.D.F. wrote, On 03/12/2007 17:12:
>> Alvaro Lopez Ortega wrote:
>>> Stefan de Konink wrote, On 03/12/2007 08:16:
>>>
>>>  > In read_config_grammer.y I found:
>>>  >
>>>  > mimetype_options : T_MAX_AGE T_NUMBER
>>>  > {
>>>  >            cherokee_mime_entry_set_maxage
(current_mime_entry, $2);
>>>  > };
>>>  >
>>>  >
>>>  > Does this need to be set in the
mimes.types file? Or somewhere else?
>>>  > Do you have an example for this?
>>>
>>> That is something that only works with Cherokee
0.5. We switched from
>>> using a Cherokee specific mime types file (0.5)
to the system wide
>>> file (0.6), and therefore we lost the ability
to specify the Max Age
>>> header within the file.
>>>
>>> I would like to address in 0.6 this right after
0.6.0 is released.
>>> The idea is to use the Max-Age as a property of
directories, requests
>>> and extensions.
>>
>> Alvaro, do you think it is worthwhile to start by
adding
>> a global parameter for the entire server ?
>>
>>     server!max_age = 300
>>
>> This could be useful to set a default max-age for
the whole server
>> instead of adding it to each mime type that can be
served
>> (some web masters like to use a whole machine to
serve
>>  static files only).
>>
>>
>> In the near future we could add it to virtual
server entries too:
>>
>>     vserver!default!max_age = 600
>>
>>
>> then to mime types, i.e.:
>>
>>     vserver!default!mime_type!image/jpeg!max_age =
500
>>     vserver!default!mime_type!image/gif!max_age =
800
>>
>>
>> and finally to single directories, i.e.:
>>
>>     vserver!default!directory!/images!max_age =
86400
>>
>>
>> If you think it is not too odd, max-age could be
added
>> to mime.types file too (i.e. an extension that does
not
>> start with . (i.e. .jpeg, .gif, etc.)
>> and it is a number then it is read as a max-age
value.
>>
>> By this way max-age could be set globally per
mime-type
>> at almost no-cost.
> 
> My original idea was to integrate it as a property of
the configuration
> entries (directories, extensions and requests). For
instance:
> 
>  vserver!default!directory!/icons!max_age = 500
> 
> or
> 
>  vserver!default!extensions!xml!max_age = 500
> 
> What would you think of that?

And regular expressions? Or would that match a 'request'?
For many
things in Cherokee I wish regular expressions were
available.


Stefan
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.7 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org


iD8DBQFHVHfyYH1+F2Rqwn0RCpblAJ4wUO94kPQ6UlrHLUATjAlVP7a6zACd
EbiX
6GlFzOeGosD96zx2j8RlWHY=
=HaMO
-----END PGP SIGNATURE-----
_______________________________________________
Cherokee mailing list
Cherokeecherokee-project.com
http://cherokee-project.com/cgi-bin/mailman/listinf
o/cherokee

Re: Re: max age option
country flaguser name
Spain
2007-12-03 16:00:38
Stefan de Konink wrote, On 03/12/2007 16:41:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA512
> 
> Alvaro Lopez Ortega schreef:
>> A.D.F. wrote, On 03/12/2007 17:12:
>>> Alvaro Lopez Ortega wrote:
>>>> Stefan de Konink wrote, On 03/12/2007
08:16:
>>>>
>>>>  > In read_config_grammer.y I found:
>>>>  >
>>>>  > mimetype_options : T_MAX_AGE
T_NUMBER
>>>>  > {
>>>>  >           
cherokee_mime_entry_set_maxage (current_mime_entry, $2);
>>>>  > };
>>>>  >
>>>>  >
>>>>  > Does this need to be set in the
mimes.types file? Or somewhere else?
>>>>  > Do you have an example for this?
>>>>
>>>> That is something that only works with
Cherokee 0.5. We switched from
>>>> using a Cherokee specific mime types file
(0.5) to the system wide
>>>> file (0.6), and therefore we lost the
ability to specify the Max Age
>>>> header within the file.
>>>>
>>>> I would like to address in 0.6 this right
after 0.6.0 is released.
>>>> The idea is to use the Max-Age as a
property of directories, requests
>>>> and extensions.
>>> Alvaro, do you think it is worthwhile to start
by adding
>>> a global parameter for the entire server ?
>>>
>>>     server!max_age = 300
>>>
>>> This could be useful to set a default max-age
for the whole server
>>> instead of adding it to each mime type that can
be served
>>> (some web masters like to use a whole machine
to serve
>>>  static files only).
>>>
>>>
>>> In the near future we could add it to virtual
server entries too:
>>>
>>>     vserver!default!max_age = 600
>>>
>>>
>>> then to mime types, i.e.:
>>>
>>>    
vserver!default!mime_type!image/jpeg!max_age = 500
>>>     vserver!default!mime_type!image/gif!max_age
= 800
>>>
>>>
>>> and finally to single directories, i.e.:
>>>
>>>     vserver!default!directory!/images!max_age =
86400
>>>
>>>
>>> If you think it is not too odd, max-age could
be added
>>> to mime.types file too (i.e. an extension that
does not
>>> start with . (i.e. .jpeg, .gif, etc.)
>>> and it is a number then it is read as a max-age
value.
>>>
>>> By this way max-age could be set globally per
mime-type
>>> at almost no-cost.
>> My original idea was to integrate it as a property
of the configuration
>> entries (directories, extensions and requests). For
instance:
>>
>>  vserver!default!directory!/icons!max_age = 500
>>
>> or
>>
>>  vserver!default!extensions!xml!max_age = 500
>>
>> What would you think of that?
> 
> And regular expressions? Or would that match a
'request'? For many
> things in Cherokee I wish regular expressions were
available.

Yeah, if we implement it in that way, it would be also
possible to use:

   vserver!default!request!^foo.*bar$!max_age = 500

In fact, there is a generic structure in which directories,
extensions and 
requests (regular expressions) are based, so once it is
implemented in that 
generic structure all of them will inherit the support.

-- 
Greetings, alo.
http://www.alobbs.com
_______________________________________________
Cherokee mailing list
Cherokeecherokee-project.com
http://cherokee-project.com/cgi-bin/mailman/listinf
o/cherokee

Re: max age option
country flaguser name
Netherlands
2008-01-04 09:52:06
I see you have implemented something  I'll check
it out 


Stefan
_______________________________________________
Cherokee mailing list
Cherokeecherokee-project.com
http://cherokee-project.com/cgi-bin/mailman/listinf
o/cherokee

Re: max age option
country flaguser name
Netherlands
2008-01-04 13:49:52
Stefan de Konink schreef:
> I see you have implemented something  I'll check
it out 

Set max-age         1, mime type 'application/xml'


It seems it only works on one specific entry (so if two
entries are 
present it won't work). It is of course an early attempt,
but diversity 
in extention vs mimetype would be appreciated.


Stefan

ps. Kudo's for you  now my
tiny webapp works 
_______________________________________________
Cherokee mailing list
Cherokeecherokee-project.com
http://cherokee-project.com/cgi-bin/mailman/listinf
o/cherokee

Re: max age option
country flaguser name
Netherlands
2008-01-05 05:41:12
A.D.F. schreef:
> Stefan de Konink wrote:
>> Stefan de Konink schreef:
>>> I see you have implemented something  I'll check
it out 
>> Set max-age         1, mime type 'application/xml'
>>
>> It seems it only works on one specific entry (so if
two entries are
>> present it won't work). It is of course an early
attempt, but diversity
>> in extention vs mimetype would be appreciated.
> 
> I guess some clarification is needed.
> 
> In cherokee configuration file (i.e.
/usr/local/etc/cherokee/cherokee.conf)
> there should be ONLY ONE LINE specifying ONLY ONE mime
file, i.e.:
> 
> server!mime_files = /usr/local/etc/cherokee/mime.types
> 
> NOTE: right now, the first time you install cherokee
0.6.0 trunk,
>       you should EDIT the mime.types file and INCLUDE
the content
>       of mime.compression.types that can be found in
the same directory
>       where the cherokee mime.types is placed.
> 
> In mime.types file you can use this syntax:
> 
> mime_type	[ .number ]	extension1[, extension2 ... ]
> 
> i.e.:
> 
> image/gif	.300	gif
> image/jpeg	.86400	jpeg, jpg, jpe
> image/png		png
> 
> Above settings mean:
>     - use a max_age value of 300 seconds (5 minutes)
for gif files;
>     - use a max_age value of 86400 seconds (1 day) for
jpeg files.
>     - do NOT use any max_age value for png files.
> 
> NOTE: it is likely that in next Cherokee release
>       (maybe 0.7, I am not sure yet),
>       above .number notation for max_age value will be
removed
>       from mime.types file and moved to cherokee.conf
file
>       in order to be handled by new administration
interface.
> 
> 
> Please Stefan, may you resend this message to
cherokeecherokee-project.com
> because my ISP filters that address in order to not
flood it with SPAM
> (I really hope this issue will be solved soon or
later).


Done 

I figured out the dot notation. But my 'issue' was that i
want to have a
fast xml and a 'slow' xsl ;)

Stefan
_______________________________________________
Cherokee mailing list
Cherokeecherokee-project.com
http://cherokee-project.com/cgi-bin/mailman/listinf
o/cherokee

Re: max age option
country flaguser name
Netherlands
2008-01-05 09:22:10
A.D.F. schreef:
> Stefan de Konink wrote:
>> A.D.F. schreef:
>>> Stefan de Konink wrote:
>>>> Stefan de Konink schreef:
>>>>> I see you have implemented something
 I'll
check it out 
>>>> Set max-age         1, mime type
'application/xml'
>>>>
>>>> It seems it only works on one specific
entry (so if two entries are
>>>> present it won't work). It is of course an
early attempt, but diversity
>>>> in extention vs mimetype would be
appreciated.
>>> I guess some clarification is needed.
>>>
>>> In cherokee configuration file (i.e.
/usr/local/etc/cherokee/cherokee.conf)
>>> there should be ONLY ONE LINE specifying ONLY
ONE mime file, i.e.:
>>>
>>> server!mime_files =
/usr/local/etc/cherokee/mime.types
>>>
>>> NOTE: right now, the first time you install
cherokee 0.6.0 trunk,
>>>       you should EDIT the mime.types file and
INCLUDE the content
>>>       of mime.compression.types that can be
found in the same directory
>>>       where the cherokee mime.types is placed.
>>>
>>> In mime.types file you can use this syntax:
>>>
>>> mime_type     [ .number ]     extension1[,
extension2 ... ]
>>>
>>> i.e.:
>>>
>>> image/gif     .300    gif
>>> image/jpeg    .86400  jpeg, jpg, jpe
>>> image/png             png
>>>
>>> Above settings mean:
>>>     - use a max_age value of 300 seconds (5
minutes) for gif files;
>>>     - use a max_age value of 86400 seconds (1
day) for jpeg files.
>>>     - do NOT use any max_age value for png
files.
>>>
>>> NOTE: it is likely that in next Cherokee
release
>>>       (maybe 0.7, I am not sure yet),
>>>       above .number notation for max_age value
will be removed
>>>       from mime.types file and moved to
cherokee.conf file
>>>       in order to be handled by new
administration interface.
>>>
>>>
>>> Please Stefan, may you resend this message to
cherokeecherokee-project.com
>>> because my ISP filters that address in order to
not flood it with SPAM
>>> (I really hope this issue will be solved soon
or later).
>> Done 
>>
>> I figured out the dot notation. But my 'issue' was
that i want to have a
>> fast xml and a 'slow' xsl ;)
> 
> Yes, I know that it is a common problem because
> xsl should have its own mime type, i.e.:
application/xls+xml
> but (unluckily) it has not been registered yet.
> 
> As a temporary (and not optimal) solution,
> you may try to remove xsl extension from
application/xml
> and add it to a new mime type, i.e.:
> 
> text/xml	xsl
> 
> # or even the undocumented
> 
> text/xsl	xsl
> 
> It should work well with most browsers even if it is
not granted for all.
> 
> 
> In the last 2 weeks I sent a few emails to discuss
> about when to schedule the requested new features about
being able
> to set a max-age value at various levels (server,
virtual server,
> mime-type, file extension, directory, etc.).
> 
> I estimated a delay of at least one month for upcoming
0.6.0
> to add and test all above features,
> so I thought to shift those changes to 0.7.x
> and to add only a minimal support in 0.6.0
> (in order to not delay 0.6.0 too much).
> 
> If you think it is useful,
> I could add other two parameters at server level:
> 
>    - server!use_max_age = BooleanValue
>      to enable / disable sending of max-age HTTP header
at server level
>      (also setable in new administration interface);
> 
>    - server!max_age = NumericValue
>      to set a default max-age value, so that mime types
without
>      a max-age value in mime.types file use that
default value anyway
>      (also setable in new administration interface).

Lets say your current 'work around' work perfectly for me.
My other two 
bugs related to UserDir authentication and/or relative
passwd files are 
not optimal, but not as critical as this one was 

I personally think that 'server' level is not smart, but
directory level is.


Stefan
_______________________________________________
Cherokee mailing list
Cherokeecherokee-project.com
http://cherokee-project.com/cgi-bin/mailman/listinf
o/cherokee

[1-9]

about | contact  Other archives ( Real Estate discussion Medical topics )