You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by Pier Fumagalli <pi...@betaversion.org> on 2002/11/25 02:33:13 UTC

Before I start a new module...

Ok, I was kindly asked by my management to write a new module for Apache
2.0, since as of _TODAY_ we're using it in production for non-static content
as well (whohooooo!)...

Before I move all my apps over on the new Apache 2.0 server, I need to be
able to strip whitespace from HTML (ok, my designers like using DreamWeaver,
not my fault), so since I can use filters, well... :-)

First question would be... Seems pretty odd that noone thought about it
before (???), so, is there a module doing that already?

If not, am I right in looking at what mod_bucketeer does for a start?

Cheeridos! :-)

    Pier


Re: Before I start a new module...

Posted by Justin Erenkrantz <je...@apache.org>.
--On Monday, November 25, 2002 1:58 AM +0000 Pier Fumagalli 
<pi...@betaversion.org> wrote:

> Since I already don't have a Content-Length header (since I don't
> know how much content I'm going to shoot out), and my boss is
> concerned about mod_deflate not being supported by (like) Netscape
> 1.3.1 when Javascript is disabled (or some stuff like that, a
> customer is a customer), well, got no options left...

In order for the server to send gzip'd data, it must send the magic 
header to the server (Accept-Encoding: gzip).  Any browser that 
doesn't support gzip wouldn't be sending that string.  There are some 
fscked browsers that send that header and don't mean it, but I 
believe they are already documented somewhere.

IIRC, the person Fitz mentioned who was writing mod_blank refused to 
use 2.0, so I don't think that'll be very helpful.  -- justin

Re: Before I start a new module...

Posted by Cliff Woolley <jw...@virginia.edu>.
On Mon, 25 Nov 2002, Pier Fumagalli wrote:

> Since I already don't have a Content-Length header (since I don't know how

And the C-L filter won't generate one for you?


Re: Before I start a new module...

Posted by Pier Fumagalli <pi...@betaversion.org>.
On 25/11/02 1:52 am, "David Crooke" <da...@convio.com> wrote:

> Why not just strip them once on install, instead of every time they are
> downloaded? You could hook something into ftp or whatever the
> Dreamweaver kids are using for upload, or a cron to come and sweep
> stuff, keeping track of what's processed using a timestamp file.

Nonono :-) The dreamwever kids use dreamweaver to create JSP templates
(evillllll) so, I am _not_ serving files off disk, I mean, I'm stupid, but
not _that_ stupid! :-) :-) :-)

Plus JSPs leave a _lot_ of crap around in files, like, several newline
characters where there shouldn't be any... And so on... It's just a _stupid_
templating system, but what the heck, they pay me to accept my designers,
so... :-)

Since I already don't have a Content-Length header (since I don't know how
much content I'm going to shoot out), and my boss is concerned about
mod_deflate not being supported by (like) Netscape 1.3.1 when Javascript is
disabled (or some stuff like that, a customer is a customer), well, got no
options left...

    Pier


Re: Before I start a new module...

Posted by David Crooke <da...@convio.com>.
Why not just strip them once on install, instead of every time they are 
downloaded? You could hook something into ftp or whatever the 
Dreamweaver kids are using for upload, or a cron to come and sweep 
stuff, keeping track of what's processed using a timestamp file.



Pier Fumagalli wrote:

>Ok, I was kindly asked by my management to write a new module for Apache
>2.0, since as of _TODAY_ we're using it in production for non-static content
>as well (whohooooo!)...
>
>Before I move all my apps over on the new Apache 2.0 server, I need to be
>able to strip whitespace from HTML (ok, my designers like using DreamWeaver,
>not my fault), so since I can use filters, well... :-)
>
>First question would be... Seems pretty odd that noone thought about it
>before (???), so, is there a module doing that already?
>
>If not, am I right in looking at what mod_bucketeer does for a start?
>
>Cheeridos! :-)
>
>    Pier
>
>  
>




Re: Before I start a new module...

Posted by Cliff Woolley <jw...@virginia.edu>.
On Sun, 24 Nov 2002, Cliff Woolley wrote:

> to hear from you.  I imagined there'd ever be a real-world use for such a
> thing, so I never commented to him about it.  Glad to hear there is one!

Er, s/ever/never/  ;)

But still, glad to hear there is one.  :)

--Cliff


Re: Before I start a new module...

Posted by Pier Fumagalli <pi...@betaversion.org>.
On 25/11/02 2:38 am, "Cliff Woolley" <jw...@virginia.edu> wrote:

> On Mon, 25 Nov 2002, Pier Fumagalli wrote:
> 
>> Before I move all my apps over on the new Apache 2.0 server, I need to be
>> able to strip whitespace from HTML (ok, my designers like using DreamWeaver,
>> not my fault), so since I can use filters, well... :-)
> 
> Funny you ask... there was a fellow on here within the last few months
> asking what we thought about him doing exactly that for his CS senior
> thesis project (I think).  Check the archives for the last few months.
> Unfortunately I've forgotten his name and the name of the module he was
> proposing... but search for "whitespace" and you'll likely find it.  I
> don't know if he actually wrote the thing or what, but I'm sure he'd like
> to hear from you.

I'll dig into the archives... That's why I asked first, because I thought I
remembered I overheard something about it...

> I imagined there'd ever be a real-world use for such a
> thing, so I never commented to him about it.  Glad to hear there is one!
> :)

Yes, DUMB templating systems, such as JSPs... And 2.0 helps when you have
idiotic stuff on the backend... Like using mod_cache to cache our
JSP-generated news... That's next, after I strip the extra whitespace! :-)

I _love_ 2.0! :-)

    Pier


Re: Before I start a new module...

Posted by Cliff Woolley <jw...@virginia.edu>.
On Mon, 25 Nov 2002, Pier Fumagalli wrote:

> Before I move all my apps over on the new Apache 2.0 server, I need to be
> able to strip whitespace from HTML (ok, my designers like using DreamWeaver,
> not my fault), so since I can use filters, well... :-)

Funny you ask... there was a fellow on here within the last few months
asking what we thought about him doing exactly that for his CS senior
thesis project (I think).  Check the archives for the last few months.
Unfortunately I've forgotten his name and the name of the module he was
proposing... but search for "whitespace" and you'll likely find it.  I
don't know if he actually wrote the thing or what, but I'm sure he'd like
to hear from you.  I imagined there'd ever be a real-world use for such a
thing, so I never commented to him about it.  Glad to hear there is one!
:)

--Cliff


Re: Before I start a new module...

Posted by Stas Bekman <st...@stason.org>.
fabio rohrich wrote:
> EHI EHI EHI, I'm still writing it!
> No easy job, 'cause I wrote a prototype now, and in my
> thesis I want to create something like a model to use
> for creating module's prototype! :)

don't reinvent the spec, check HTML::Clean
http://search.cpan.org/author/LINDNER/HTML-Clean-0.8/lib/HTML/Clean.pm
the code is here: http://search.cpan.org/src/LINDNER/HTML-Clean-0.8/

I'm not saying that you have to use the Perl module, just suggesting to 
reuse the spec.

Also mod_perl has an Apache::Clean filter (uses HTML::Clean) which I 
think works with 2.0 already, so if you have mod_perl 2.0 loaded, you 
can run this filter, without doing any work.
http://search.cpan.org/author/GEOFF/Apache-Clean-2.00b/Clean.pm

__________________________________________________________________
Stas Bekman            JAm_pH ------> Just Another mod_perl Hacker
http://stason.org/     mod_perl Guide ---> http://perl.apache.org
mailto:stas@stason.org http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com


Re: Before I start a new module...

Posted by fabio rohrich <ro...@yahoo.it>.
EHI EHI EHI, I'm still writing it!
No easy job, 'cause I wrote a prototype now, and in my
thesis I want to create something like a model to use
for creating module's prototype! :)




 --- Dirk-Willem van Gulik <di...@webweaving.org> ha
scritto: > 
> Did you add it to modules.apache.org ? That is for
> sure a good place to
> make sure you are found.
> 
> On Mon, 25 Nov 2002, [iso-8859-1] fabio rohrich
> wrote:
> 
> > And here I am! Hi my italian colleague! I'm
> stripping
> > out the white spaces from HTML, it's true.
> > It's not so easy to strip out the garbage from
> html
> > code, anyway I can give u the document I wrote in
> > which there all the requirements to delete white
> > spaces (where and when).
> >
> > Let me know if u need help!
> > Write me personally if u need (rostich77@yahoo.it)
> > Ciao,
> >  Fabio
> >
> >
> > --- Aaron Bannert <aa...@clove.org> ha scritto: >
> > Knowing nothing about your setup, I would suggest
> > > instead writing
> > > a simple script (perl or whatever) that
> traverses
> > > your docroot and
> > > /compresses/ the whitespace out of your files,
> > > instead of doing
> > > it dynamically and per-request.
> > >
> > > my 2c,
> > > -aaron
> > >
> > >
> > > On Sunday, November 24, 2002, at 05:33  PM, Pier
> > > Fumagalli wrote:
> > >
> > > > Ok, I was kindly asked by my management to
> write a
> > > new module for
> > > > Apache
> > > > 2.0, since as of _TODAY_ we're using it in
> > > production for non-static
> > > > content
> > > > as well (whohooooo!)...
> > > >
> > > > Before I move all my apps over on the new
> Apache
> > > 2.0 server, I need to
> > > > be
> > > > able to strip whitespace from HTML (ok, my
> > > designers like using
> > > > DreamWeaver,
> > > > not my fault), so since I can use filters,
> well...
> > > :-)
> > > >
> > > > First question would be... Seems pretty odd
> that
> > > noone thought about it
> > > > before (???), so, is there a module doing that
> > > already?
> > > >
> > > > If not, am I right in looking at what
> > > mod_bucketeer does for a start?
> > > >
> > > > Cheeridos! :-)
> > > >
> > > >     Pier
> > >
> >
> >
>
______________________________________________________________________
> > Mio Yahoo!: personalizza Yahoo! come piace a te
> >
>
http://it.yahoo.com/mail_it/foot/?http://it.my.yahoo.com/
> >
>  

______________________________________________________________________
Mio Yahoo!: personalizza Yahoo! come piace a te 
http://it.yahoo.com/mail_it/foot/?http://it.my.yahoo.com/

Re: Before I start a new module...

Posted by Dirk-Willem van Gulik <di...@webweaving.org>.
Did you add it to modules.apache.org ? That is for sure a good place to
make sure you are found.

On Mon, 25 Nov 2002, [iso-8859-1] fabio rohrich wrote:

> And here I am! Hi my italian colleague! I'm stripping
> out the white spaces from HTML, it's true.
> It's not so easy to strip out the garbage from html
> code, anyway I can give u the document I wrote in
> which there all the requirements to delete white
> spaces (where and when).
>
> Let me know if u need help!
> Write me personally if u need (rostich77@yahoo.it)
> Ciao,
>  Fabio
>
>
> --- Aaron Bannert <aa...@clove.org> ha scritto: >
> Knowing nothing about your setup, I would suggest
> > instead writing
> > a simple script (perl or whatever) that traverses
> > your docroot and
> > /compresses/ the whitespace out of your files,
> > instead of doing
> > it dynamically and per-request.
> >
> > my 2c,
> > -aaron
> >
> >
> > On Sunday, November 24, 2002, at 05:33  PM, Pier
> > Fumagalli wrote:
> >
> > > Ok, I was kindly asked by my management to write a
> > new module for
> > > Apache
> > > 2.0, since as of _TODAY_ we're using it in
> > production for non-static
> > > content
> > > as well (whohooooo!)...
> > >
> > > Before I move all my apps over on the new Apache
> > 2.0 server, I need to
> > > be
> > > able to strip whitespace from HTML (ok, my
> > designers like using
> > > DreamWeaver,
> > > not my fault), so since I can use filters, well...
> > :-)
> > >
> > > First question would be... Seems pretty odd that
> > noone thought about it
> > > before (???), so, is there a module doing that
> > already?
> > >
> > > If not, am I right in looking at what
> > mod_bucketeer does for a start?
> > >
> > > Cheeridos! :-)
> > >
> > >     Pier
> >
>
> ______________________________________________________________________
> Mio Yahoo!: personalizza Yahoo! come piace a te
> http://it.yahoo.com/mail_it/foot/?http://it.my.yahoo.com/
>


Re: Before I start a new module...

Posted by fabio rohrich <ro...@yahoo.it>.
And here I am! Hi my italian colleague! I'm stripping
out the white spaces from HTML, it's true.
It's not so easy to strip out the garbage from html
code, anyway I can give u the document I wrote in
which there all the requirements to delete white
spaces (where and when).

Let me know if u need help!
Write me personally if u need (rostich77@yahoo.it)
Ciao,
 Fabio


--- Aaron Bannert <aa...@clove.org> ha scritto: >
Knowing nothing about your setup, I would suggest
> instead writing
> a simple script (perl or whatever) that traverses
> your docroot and
> /compresses/ the whitespace out of your files,
> instead of doing
> it dynamically and per-request.
> 
> my 2c,
> -aaron
> 
> 
> On Sunday, November 24, 2002, at 05:33  PM, Pier
> Fumagalli wrote:
> 
> > Ok, I was kindly asked by my management to write a
> new module for 
> > Apache
> > 2.0, since as of _TODAY_ we're using it in
> production for non-static 
> > content
> > as well (whohooooo!)...
> >
> > Before I move all my apps over on the new Apache
> 2.0 server, I need to 
> > be
> > able to strip whitespace from HTML (ok, my
> designers like using 
> > DreamWeaver,
> > not my fault), so since I can use filters, well...
> :-)
> >
> > First question would be... Seems pretty odd that
> noone thought about it
> > before (???), so, is there a module doing that
> already?
> >
> > If not, am I right in looking at what
> mod_bucketeer does for a start?
> >
> > Cheeridos! :-)
> >
> >     Pier
>  

______________________________________________________________________
Mio Yahoo!: personalizza Yahoo! come piace a te 
http://it.yahoo.com/mail_it/foot/?http://it.my.yahoo.com/

Re: Before I start a new module...

Posted by Aaron Bannert <aa...@clove.org>.
Knowing nothing about your setup, I would suggest instead writing
a simple script (perl or whatever) that traverses your docroot and
/compresses/ the whitespace out of your files, instead of doing
it dynamically and per-request.

my 2c,
-aaron


On Sunday, November 24, 2002, at 05:33  PM, Pier Fumagalli wrote:

> Ok, I was kindly asked by my management to write a new module for 
> Apache
> 2.0, since as of _TODAY_ we're using it in production for non-static 
> content
> as well (whohooooo!)...
>
> Before I move all my apps over on the new Apache 2.0 server, I need to 
> be
> able to strip whitespace from HTML (ok, my designers like using 
> DreamWeaver,
> not my fault), so since I can use filters, well... :-)
>
> First question would be... Seems pretty odd that noone thought about it
> before (???), so, is there a module doing that already?
>
> If not, am I right in looking at what mod_bucketeer does for a start?
>
> Cheeridos! :-)
>
>     Pier