Icon View Thread

The following is the text of the current message along with any replies.
Messages 11 to 20 of 21 total
Thread EWB Web Server GZIP compression
Wed, Jun 29 2016 12:33 PMPermanent Link

Trinione

<< Let me be clear here - the EWB Web Server was never really intended to take the place of a mainstream, production web server.  It was put in place primarily to give everyone *something* to use for dataset/module support on the back-end for smaller installations (originally it was only for internal use in the IDE).  But, if you think that it's going to compete with mainstream web servers in terms of a feature set, you will be sadly disappointed.  I'm going to add features to the EWB Web Server as I get time to do so, and as they are warranted, but the main focus of EWB will always be the IDE/client runtime. >>

Hi Tim:
I was unaware that the EWS was intended as such. Perhaps this information should be in the documentation.

As a solution, I am wondering if the file can be GZIPPED and stored on the hard drive. I think we just think GZIP because it is built into the web server. Perhaps the file itself can be gzipped and uploaded to the server. Going to chk into this.

AND YES - more focus on the IDE/client runtime. I fully support this. There are some component and tweaks to the current set that would continue to define EWB as on the best apps ever.
Wed, Jun 29 2016 1:04 PMPermanent Link

Raul

Team Elevate Team Elevate

On 6/29/2016 12:33 PM, Trinione wrote:
> As a solution, I am wondering if the file can be GZIPPED and stored on the hard drive. I think we just think GZIP because it is built into the web server. Perhaps the file itself can be gzipped and uploaded to the server. Going to chk into this.

I highly doubt this would work at all. 2 issues i see:

- compression is supposed to be only applied when client supports it and
specified so in the request headers (the Accept-Encoding field) - right
away you're eliminating support for clients that don't support compression.

- bigger issue is that how is browser supposed to deal with this. AFAIK
you can't just call file a "myapp.js" and gzip the content and expect
the browser to decompress it by somehow detecting file format.

I know you said you don't want to use another component but you can
literally setup nginx in approx 5 minutes to support this (after doing
10 min of googling).

Raul
Wed, Jun 29 2016 1:59 PMPermanent Link

Trinione

<< I know you said you don't want to use another component but you can
literally setup nginx in approx 5 minutes to support this (after doing
10 min of googling). >>

Raul:
I just doubled that time to 20 minutes of googling. Found and installed Nginx, followed some instructions on reverse proxy/gzip and not working and I am done with that. SmileIf I don't get out now I may well be 'working at it' for the next 24-hours non stop.

This app is for an specific company all users using Chrome. So, the users waiting 1 second longer for now is no biggie. Once the PHP/Datasets come on board with 2.05, my apps shall run off Apache Web Server which has gzip compression.

Thanks for the assistance and direction.
Wed, Jun 29 2016 4:01 PMPermanent Link

Raul

Team Elevate Team Elevate

On 6/29/2016 1:59 PM, Trinione wrote:
> Raul:
> I just doubled that time to 20 minutes of googling. Found and installed Nginx, followed some instructions on reverse proxy/gzip and not working and I am done with that. SmileIf I don't get out now I may well be 'working at it' for the next 24-hours non stop.

Now i feel bad.

Here is a basic nginx config file for using it for revrese proxy with
gzip support:

EWB web server is on same PC as NGINX on port 8888
NGINX listens on port 80 and proxies all traffic to port 888 as well as
has gzip support

When connecting EWB WS using port 8888 the partial headers look like this :
Content-Length: 3105
Content-Type: application/json; charset=utf-8
Server: Elevate Web Builder Web Server

and when connecting thru port 80 i see this:
Content-Encoding: gzip
Content-Type: application/json; charset=utf-8
Server: nginx/1.11.1
Transfer-Encoding: chunked

To set this up just download nginx

http://nginx.org/en/download.html

and then use the config file below (between ==== lines) and use
appropriate port/ip info :

==========================================================
worker_processes  1;
events {
    worker_connections  1024;
}
http {
    upstream ewbws {
             server 127.0.0.1:8888;
            }      
      gzip  on;
      gzip_min_length    256;
      gzip_proxied any;
      gzip_types text/plain text/xml text/css application/json
application/x-javascript;
      gzip_vary on;
      gzip_disable "MSIE [1-6]\.(?!.*SV1)";      
            
    server {
        listen       80;

        location / {
            proxy_pass      http://ewbws;
            proxy_redirect          off;
              proxy_next_upstream     error timeout invalid_header http_500
http_502 http_503 http_504;
                   proxy_redirect off;
                 proxy_buffering off;              
              proxy_set_header        Host            $host;
              proxy_set_header        X-Real-IP       $remote_addr;
              proxy_set_header        X-Forwarded-For
$proxy_add_x_forwarded_for;
          }
    }
}


==========================================================

Thu, Jun 30 2016 11:03 AMPermanent Link

Trinione

Raul:
Thanks for the code. It helped me somewhat. I reinstalled nginx and included it in the conf file. Now, pointing to localhost shows the EWB app, however, it takes over 1 minute to load any of several files each time around. This is the 'blind work tunnel' I am wary of going forward. Too many years have been spent in this zone.

The solution to this situation for me is to let the users spend an extra second loading the non-zip version AND when Tim releases 2.05/PHP/Linux ability use Apache's gizp functionality.

Thanks for giving me reason to actually install Nginx though. I have wanted a reason to use it for some time. Albeit ever so briefly.
Thu, Jun 30 2016 12:54 PMPermanent Link

Raul

Team Elevate Team Elevate

Trinione wrote:
<<
Thanks for the code. It helped me somewhat. I reinstalled nginx and included it in the conf file. Now, pointing to localhost shows the EWB app, however, it takes over 1 minute to load any of several files each time around. This is the 'blind work tunnel' I am wary of going forward. Too many years have been spent in this zone.
>>
Curious - it runs super fast her (it is all on the lan). We use nginx in our environment fair bit - makes it easy to do a failover load balancer

I'll try this out more thoroughly and see if i can dupe the slowness issue

Raul
Thu, Jun 30 2016 1:18 PMPermanent Link

Trinione

<< Curious - it runs super fast her (it is all on the lan). We use nginx in our environment fair bit - makes it easy to do a failover load balancer
I'll try this out more thoroughly and see if i can dupe the slowness issue >>

Raul:
I used nginx 1.11.1. But, I would say if it ain't broke don't fix it.
Thu, Jun 30 2016 2:26 PMPermanent Link

Trinione

Trinione wrote:

<< Curious - it runs super fast her (it is all on the lan). We use nginx in our environment fair bit - makes it easy to do a failover load balancer
I'll try this out more thoroughly and see if i can dupe the slowness issue >>

Raul:
My bad. I thought I had to also rename 'ewbws' to my server name. Fixed my error, and now page loads pronto! Smile

Only remaining issue is that GZip is not compressing files. For example, the file size for an original .js is 715KB, and Network Size shows 715KB.

I left your Gzip instructions unchanged:

     gzip  on;
     gzip_min_length    256;
     gzip_proxied any;
     gzip_types text/plain text/xml text/css application/json application/x-javascript;
     gzip_vary on;
     gzip_disable "MSIE [1-6]\.(?!.*SV1)";      
Thu, Jun 30 2016 3:10 PMPermanent Link

Trinione

Raul:

gzip  on;
gzip_vary on;
gzip_min_length    256;
gzip_proxied any;
gzip_types text/plain application/javascript application/x-javascript text/javascript text/xml text/css;
#gzip_disable "MSIE [1-6]\.(?!.*SV1)";      
#gzip_disable "MSIE6";

Two main changes are gzip_disable and, needed to add 'application/javascript'. Then all files gzipped. Without 'application/javascript' the js files were not compressing.

I just commented out the gzip_disable line. But, this page helped me track down the issue  I was experiencing also. http://stackoverflow.com/questions/11929977/nginx-server-contents-gzip-compress-not-working.

Thanks again.
Thu, Jun 30 2016 5:42 PMPermanent Link

Raul

Team Elevate Team Elevate

<<
Trinione wrote:


Two main changes are gzip_disable and, needed to add 'application/javascript'. Then all files gzipped. Without 'application/javascript' the js files were not compressing.
>>

Good fix! Thanks for tracking this down - i'll update our config as well..

Is this resulting in improved performance on client side when loading EWB app now ?

Raul
« Previous PagePage 2 of 3Next Page »
Jump to Page:  1 2 3
Image