on 2010 Oct 26 12:02 PM
Here's a suggestion posted on the NNTP forum; I looks like A Good Thing...
On 20 Oct 2010 00:35:53 -0700, LM wrote:
Add support for HTTP compression in SQL Anywhere built in web server. See http://www.http-compression.com/ for details. It is a standard web technique, which reduces HTML traffic up to 4 times.
LM
Request clarification before answering.
I've added this to our "stuff to look into" list. Note that the website linked to doesn't exist - or at least it has no DNS entry.
C:\\Documents and Settings\\bcarter>ping www.http-compression.com Pinging www.http-compression.com [213.239.195.236] with 32 bytes of data: Reply from 213.239.195.236: bytes=32 time=153ms TTL=52 Reply from 213.239.195.236: bytes=32 time=152ms TTL=52 Reply from 213.239.195.236: bytes=32 time=155ms TTL=52 Reply from 213.239.195.236: bytes=32 time=154ms TTL=52 Ping statistics for 213.239.195.236: Packets: Sent = 4, Received = 4, Lost = 0 (0% loss), Approximate round trip times in milli-seconds: Minimum = 152ms, Maximum = 155ms, Average = 153ms
Strange. Must be a Sybase thing:
[C:\\WINDOWS]ping www.http-compression.com Ping request could not find host www.http-compression.com. Please check the name and try again.
http://downforeveryoneorjustme.com/www.http-compression.com says it's up too.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I'd say it must be a plot by the Corporate Internet Police...
Maybe the site was temporarily unavailable while being compressed?
Actually, it is possible so serve compressed HTTP content using current SA versions, but it requires some additional coding (see example below). So, a built-in HTTP compression would still be a more robust and usable solution. P.S. You can check if your page is compressed using this online tool: Port80 Software
CREATE FUNCTION "sp_client_accepts_encoding"(IN @Algorithm CHAR(100))
RETURNS INTEGER
BEGIN /* returns 1 if client (browser) accepts given HTTP compression algorithm (according to Accept-Encoding HTTP header values) */
DECLARE @List LONG VARCHAR;
SELECT value INTO @List FROM sa_http_header_info('Accept-Encoding');
IF EXISTS (select 1 from sa_split_list(@List) where row_value = @Algorithm) THEN
RETURN 1;
ELSE
RETURN 0;
END IF;
END
GO
CREATE FUNCTION "sp_compress_page_if_accepted"(IN @HTML_page LONG BINARY)
RETURNS LONG BINARY
NOT DETERMINISTIC
BEGIN
IF sp_client_accepts_encoding('gzip') = 1 THEN // client (browser) accepts compression
CALL dbo.sa_set_http_header('Content-Encoding', 'gzip');
RETURN COMPRESS(@HTML_page, 'gzip'); // return compressed page
ELSE
RETURN @HTML_page; // return uncompressed page
END IF;
END
GO
CREATE SERVICE "hello" TYPE 'RAW' AUTHORIZATION OFF USER "dba" AS
SELECT sp_compress_page_if_accepted('Hello, world!');
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Another solution for current versions of SQL Anywhere is to sit the database server behind a Reverse Proxy that is capable of compressing the responses. E.g. Apache via mod_proxy or the latest versions of IIS (7.0 and 7.5).
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
75 | |
30 | |
9 | |
8 | |
7 | |
6 | |
6 | |
5 | |
5 | |
5 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.