GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
LeadingBlankSpaces(3) User Contributed Perl Documentation LeadingBlankSpaces(3)

Compress::LeadingBlankSpaces - Perl class to compress leading blank spaces in (HTML, JavaScript, etc.) web content.

  use Compress::LeadingBlankSpaces;

  my $lco_r = Compress::LeadingBlankSpaces->new();
  . . .
  my $source_string = '     some content'."\n";
  . . .
  my $outgoing_string = $lco_r->squeeze_string ($source_string);
  . . .
  my $squeeze_status = $lco_r->format_status(); # to check later...

This class provides the functionality for the most simple web content compression.

Basically, the outgoing web content (HTML, JavaScript, etc.) contains a lot of leading blank spaces, because of being structured on development stage. Usually, the browser ignores all leading blank spaces. Indeed, the amount of those blank spaces is significant and could be estimated as 10 to 20 percent of the length of regular web page. We can reduce this part of the web traffic on busy servers with no visible impact on transferred web content. This could be helpful especially for old browsers incapable to understand modern content compression.

The main functionality of this class is concentrated within the "squeeze_string" member function that is supposed to be used inside the data transfer loop on server side. The rest of the class is developed to serve possible exceptions, like pre-formatted data within HTML.

In this version of the class, there are three tags those produce compression exceptions:

<CODE ...> ... </CODE>

<PRE ...> ... </PRE>

<TEXTAREA ...> ... </TEXTAREA>

case insensitive in implementation.

Nesting of exceptions is not supported.

Slava Bizyayev <slava@cpan.org> - Freelance Software Developer & Consultant.

Copyright (C) 2002-2004 Slava Bizyayev. All rights reserved.

This package is free software. You can use it, redistribute it, and/or modify it under the same terms as Perl itself. The latest version of this module can be found on CPAN.

"Web Content Compression FAQ" at http://perl.apache.org/docs/tutorials/client/compression/compression.html

"Apache::Dynagzip" module can be found on CPAN.

2004-08-01 perl v5.32.1

Search for    or go to Top of page |  Section 3 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.