Thanks, I have tried setting the deflate flag using the ?sc_set_deflate macro like below. But still I could not see the output compressed from yaws, are there any dependencies or packages to be installed? How should I verify this, as of now I am using curl?

    DeflateOptions = #deflate{mime_types = all,
                              compression_level = best_compression},
    DefaultGC = yaws_config:make_default_gconf(Debug, Id),
    GC = DefaultGC#gconf{logdir="./log/", log_wrap_size = 100000000},
    SC = #sconf{port = Port,
                %% servername = "ubuntu01",
                listen = {0,0,0,0},
                docroot = "./www/",
                appmods = [{"/", yaws_callback, [["style"]]}],
                deflate_options = DeflateOptions
    UpdatedSC = ?sc_set_deflate(SC, true),
    _Result = yaws_api:setconf(GC, [[UpdatedSC]]),

and curl command that I am using to test is 

curl -I 'http://localhost/' -H 'Accept-Encoding: gzip,deflate,sdch' -H 'Accept-Language: en-US,en;q=0.8' -H 'User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/34.0.1847.116 Safari/537.36' -H 'Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8' -H 'Cache-Control: max-age=0' -H 'Cookie: m=3247:t|34e2:|ca3:t' -H 'Connection: keep-alive' --compressed



On Wed, Apr 16, 2014 at 6:56 PM, Christopher Faulet <christopher.faulet@capflam.org> wrote:
On 16/04/2014 14:36, Marutha wrote:
> Hi,
> I am running yaws in embedded mode and I would like to enable the
> deflate option so I created sconf like below,
> DeflateOptions*=**#**deflate*{mime_types*=*all,
>                             compression_level*=*best_compression},
> SC*=**#sconf*{port*=*Port,
>                    listen*=*{0,0,0,0},
>                    docroot*=*"./www/",
>                    appmods*=*[{"/", yaws_callback, [["style"]]}],
>                    deflate_options*=*DeflateOptions
>                   },
> I tried the default record of deflate{} too. but I could not find the
> output to be compressed when started yaws in embedded mode. Is there
> something I have missed out ? I am starting yaws using
> application:start(yaws) and then later yaws_api:set_conf function. Could
> this be a problem? or yaws should be started after yaws_api:set_conf
> function is called?


#sconf.deflate_options si used to define the behavior of Yaws when the
deflate option is enabled. To enable it, you need to update #sconf.flags
field by calling the macro ?sc_set_deflate.


Learn Graph Databases - Download FREE O'Reilly Book
"Graph Databases" is the definitive new guide to graph databases and their
applications. Written by three acclaimed leaders in the field,
this first edition is now available. Download your free book today!
Erlyaws-list mailing list