WordPress.org

Ready to get started?Download WordPress

Forums

JSON API
Json api-> iphone, enable gzip? (1 post)

  1. DJElo
    Member
    Posted 1 year ago #

    Hey, thanks for the great api :)
    I am having bit of an issue in that I want to optimise the downloading so gzip would be great.
    But for some reason when I make requests via the iphone (tested on both iOS 6/7) I don't get gzip content back.
    this is the header for the request:
    GET /?json=get_recent/posts&count=10 HTTP/1.1
    Host: snowbrains.com
    Accept-Encoding: gzip, deflate
    Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
    Accept-Language: en-us
    Connection: keep-alive
    User-Agent: Mozilla/5.0 (iPhone; CPU iPhone OS 6_1 like Mac OS X) AppleWebKit/536.26 (KHTML, like Gecko) Version/6.0 Mobile/10B141 Safari/8536.25

    response:
    HTTP/1.1 200 OK
    Date: Sat, 30 Nov 2013 10:47:48 GMT
    Server: Apache
    X-Pingback: http://snowbrains.com/xmlrpc.php
    Vary: User-Agent
    Keep-Alive: timeout=5, max=100
    Connection: Keep-Alive
    Transfer-Encoding: chunked
    Content-Type: application/json; charset=UTF-8

    but when I run the same query via safari with fake user-agent on os x I get instead:
    GET /?json=get_recent_posts&count=10&dev=1 HTTP/1.1
    Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
    User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9) AppleWebKit/537.71 (KHTML, like Gecko) Version/7.0 Safari/537.71
    Accept-Language: en-us
    Accept-Encoding: gzip, deflate
    Connection: keep-alive

    and response :
    HTTP/1.1 200 OK
    Date: Sat, 30 Nov 2013 10:49:21 GMT
    Server: Apache
    Expires: Wed, 11 Jan 1984 05:00:00 GMT
    Cache-Control: no-cache, must-revalidate, max-age=0
    Pragma: no-cache
    Vary: Accept-Encoding
    Content-Encoding: gzip
    Keep-Alive: timeout=5, max=96
    Connection: Keep-Alive
    Transfer-Encoding: chunked
    Content-Type: text/plain; charset: UTF-8

    I know I can get gzip content as when I use the jetpack json api calls I always get back gzip content.
    Anyone who can help me figure this out please?

    http://wordpress.org/plugins/json-api/

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags