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

asked 26 Oct '10, 11:02

Breck%20Carter's gravatar image

Breck Carter
27.0k444614889
accept rate: 21%


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.


From Breck: Allow me to retort...

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


From Graeme:

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.

permanent link

answered 26 Oct '10, 13:12

Graeme%20Perrow's gravatar image

Graeme Perrow
8.7k374112
accept rate: 51%

edited 26 Oct '10, 15:37

You actually thought I hadn't tested the link... more than once...?

(26 Oct '10, 14:04) Breck Carter
Comment Text Removed
2

I'd say it must be a plot by the Corporate Internet Police...

(26 Oct '10, 16:40) Bill Aumen
1

Maybe the site was temporarily unavailable while being compressed?

(27 Oct '10, 07:07) Reimer Pods

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!');
permanent link

answered 30 Jan '11, 16:17

Linas%20Med%C5%BEi%C5%ABnas's gravatar image

Linas Medžiūnas
391
accept rate: 0%

Linas... clever stuff, but I'm totally with LM and Breck on this... If SQLA is a web server (which I guess it is), we shouldn't have write database functions to handle this. The web server should just 'know' to do this.

(04 Feb '11, 00:43) Ron Hiner

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).

permanent link

answered 01 Feb '11, 05:29

Nick%20Brooks's gravatar image

Nick Brooks
528182032
accept rate: 50%

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×107

question asked: 26 Oct '10, 11:02

question was seen: 1,089 times

last updated: 01 Feb '11, 05:29