Кажется, ошибка Yahoo Weather API в том, что каждый раз, когда я отправляю запрос, я получаю одну и ту же погоду. Что интересно, в ответе нет поля для отметки времени для определения времени погоды.
$ curl "http://weather.yahooapis.com/forecastjson?p=CHXX0099&u=c" -v
* About to connect() to weather.yahooapis.com port 80 (#0)
* Trying 180.233.115.34... connected
* Connected to weather.yahooapis.com (180.233.115.34) port 80 (#0)
> GET /forecastjson?p=CHXX0099&u=c HTTP/1.1
> User-Agent: curl/7.21.3 (i386-redhat-linux-gnu) libcurl/7.21.3 NSS/3.12.9.0 zlib/1.2.5 libidn/1.19 libssh2/1.2.7
> Host: weather.yahooapis.com
> Accept: */*
>
< HTTP/1.1 200 OK
< Date: Tue, 31 May 2011 12:58:10 GMT
< Cache-Control: private, max-age=1200
< Expires: Tue, 31 May 2011 13:18:10 GMT
< Connection: close
< Transfer-Encoding: chunked
< Content-Type: application/json;charset=UTF-8
<
* Closing connection #0
{"units":{"temperature":"C","speed":"km\/h","distance":"km","pressure":"mb"},"location":{"location_id":"CHXX0099","city":"Nanjing","state_abbreviation":"JI","country_abbreviation":"CH","elevation":3,"latitude":32,"longitude":118.80000000000000},"wind":{"speed":6.00000000000000,"direction":"N"},"atmosphere":{"humidity":"22","visibility":12.01000000000000,"pressure":1024.00000000000000,"rising":""},"url":"http:\/\/weather.yahoo.com\/forecast\/CHXX0099.html","logo":"http:\/\/l.yimg.com\/a\/i\/us\/nt\/ma\/ma_nws-we_1.gif","astronomy":{"sunrise":"06:22","sunset":"18:09"},"condition":{"text":"Sunny","code":"32","image":"http:\/\/l.yimg.com\/a\/i\/us\/we\/52\/32.gif","temperature":14.00000000000000},"forecast":[{"day":"Today","condition":"Mostly Clear","high_temperature":13.00000000000000,"low_temperature":3.00000000000000},{"day":"Tomorrow","condition":"Partly Cloudy","high_temperature":16.00000000000000,"low_temperature":5.00000000000000}]}
Однако, если я запрашиваю тот же интерфейс через VPN, возвращаемые данные будут правильными.
$ curl "http://weather.yahooapis.com/forecastjson?p=CHXX0099&u=c" -v
* About to connect() to weather.yahooapis.com port 80 (#0)
* Trying 180.233.115.34... connected
* Connected to weather.yahooapis.com (180.233.115.34) port 80 (#0)
> GET /forecastjson?p=CHXX0099&u=c HTTP/1.1
> User-Agent: curl/7.21.3 (i386-redhat-linux-gnu) libcurl/7.21.3 NSS/3.12.9.0 zlib/1.2.5 libidn/1.19 libssh2/1.2.7
> Host: weather.yahooapis.com
> Accept: */*
>
< HTTP/1.1 200 OK
< Date: Tue, 31 May 2011 12:58:10 GMT
< Cache-Control: private, max-age=1200
< Expires: Tue, 31 May 2011 13:18:10 GMT
< Connection: close
< Transfer-Encoding: chunked
< Content-Type: application/json;charset=UTF-8
<
* Closing connection #0
{"units":{"temperature":"C","speed":"km\/h","distance":"km","pressure":"mb"},"location":{"location_id":"CHXX0099","city":"Nanjing","state_abbreviation":"JI","country_abbreviation":"CH","elevation":3,"latitude":32,"longitude":118.80000000000000},"wind":{"speed":6.00000000000000,"direction":"N"},"atmosphere":{"humidity":"22","visibility":12.01000000000000,"pressure":1024.00000000000000,"rising":""},"url":"http:\/\/weather.yahoo.com\/forecast\/CHXX0099.html","logo":"http:\/\/l.yimg.com\/a\/i\/us\/nt\/ma\/ma_nws-we_1.gif","astronomy":{"sunrise":"06:22","sunset":"18:09"},"condition":{"text":"Sunny","code":"32","image":"http:\/\/l.yimg.com\/a\/i\/us\/we\/52\/32.gif","temperature":14.00000000000000},"forecast":[{"day":"Today","condition":"Mostly Clear","high_temperature":13.00000000000000,"low_temperature":3.00000000000000},{"day":"Tomorrow","condition":"Partly Cloudy","high_temperature":16.00000000000000,"low_temperature":5.00000000000000}]}
Лично я думаю, что это связано с материалами Varnish или Squid. Вы также затронуты этой проблемой? Прежде чем я смогу найти официальную ссылку поддержки, что я могу сделать, чтобы закончить кэш на стороне сервера?