Support for gzip compression!

 
  • Support for gzip compression!

    I just started using the last.fm API and found out that the servers do not support gzip compression.

    I think that is strange. Using GZIP on XML content will typically result in 70-80% less size. That would not only significantly reduce traffic on clinets and improve speed, it would also reduce traffic on the servers. So even last.fm would have quite a benefit, and enabling gzip on servers should not be a big issue. Of cause, clients need to explicitly request and use GZIP, but that is done with few lines of code.

    I have submitted a suggestion here:

    http://www.google.com/moderator/#8/e=2c6a

    Please vote if you also want to reduce traffic and improve download speed for your clients!

    • tburny said...
    • Forum Moderator
    • 27 Jul 2012, 14:42
    Edit:
    Please can you tell me which calls you are doing?

    I ran a quick test with the Chrome Inspector and http://www.combofm.de and it works fine:


    Request URL:http://ws.audioscrobbler.com/2.0/?user=tburny&limit=30&method=user.getTopArtists&api_key=3505b8bcad2a8fa2a1467a747869a63c&callback=jsonp1343400852294&format=json
    Request Method:GET
    Status Code:200 OK
    Request Headers
    Accept:*/*
    Accept-Charset:ISO-8859-1,utf-8;q=0.7,*;q=0.3
    Accept-Encoding:gzip,deflate,sdch
    Accept-Language:de-DE,de;q=0.8,en-US;q=0.6,en;q=0.4
    Connection:keep-alive
    Host:ws.audioscrobbler.com
    Referer:http://www.combofm.de/station/
    User-Agent:Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/535.19 (KHTML, like Gecko) Ubuntu/12.04 Chromium/18.0.1025.168 Chrome/18.0.1025.168 Safari/535.19
    Query String Parametersview URL encoded
    user:tburny
    limit:30
    method:user.getTopArtists
    api_key:3505b8bcad2a8fa2a1467a747869a63c
    callback:jsonp1343400852294
    format:json


    Response Headers
    Access-Control-Allow-Methods:POST, GET, OPTIONS
    Access-Control-Allow-Origin:*
    Access-Control-Max-Age:86400
    Cache-Control:max-age=86400
    Connection:close
    Content-Encoding:gzip
    Content-Length:2734
    Content-Type:text/javascript; charset=utf-8;
    Date:Fri, 27 Jul 2012 14:54:12 GMT
    Expires:Sat, 28 Jul 2012 14:54:12 GMT
    Server:Apache/2.2.22 (Unix)
    Vary:Accept-Encoding
    X-Web-Node:www198

    Combo.fm: Combine your favourite radio stations! | My Blog | scala-lastfmapi | Cache2k - A high performance Java in-memory cache
    P.S.: Do not click here
    throw new PokemonException(); //Gotta catch 'em all
    My forum post reflects my personal opinion :)
Anonymous users may not post messages. Please log in or create an account to post in the forums.