removeHeader("Pragma") not working
See original GitHub issueWhat kind of issue is this? Bug Report
hi, i’ve been trying to cache a response from a test rest api from http://jsonplaceholder.typicode.com
D/OkHttp: --> GET http://jsonplaceholder.typicode.com/posts/ http/1.1 D/OkHttp: --> END GET D/OkHttp: <-- 200 OK http://jsonplaceholder.typicode.com/posts/ (2597ms) D/OkHttp: Content-Type: application/json; charset=utf-8 D/OkHttp: Transfer-Encoding: chunked D/OkHttp: Connection: keep-alive D/OkHttp: Pragma: no-cache D/OkHttp: Date: Mon, 15 Aug 2016 07:37:59 GMT D/OkHttp: Set-Cookie: __cfduid=d7a80d31f44b803e5756cb4712926db891471246679; expires=Tue, 15-Aug-17 07:37:59 GMT; path=/; domain=.typicode.com; HttpOnly D/OkHttp: X-Powered-By: Express D/OkHttp: Vary: Accept-Encoding D/OkHttp: Access-Control-Allow-Credentials: true D/OkHttp: Expires: Mon, 15 Aug 2016 11:37:59 GMT D/OkHttp: X-Content-Type-Options: nosniff D/OkHttp: Etag: W/“6b80-uPwhAkDat3Fl5TugzmyYpQ” D/OkHttp: Via: 1.1 vegur D/OkHttp: CF-Cache-Status: HIT D/OkHttp: Server: cloudflare-nginx D/OkHttp: CF-RAY: 2d2afc05360e22be-LAX D/OkHttp: Cache-Control: max-age=20 D/OkHttp: <-- END HTTP
i was successfully caching that response, along with also modifying the cache-control, however, all my efforts to remove Pragma: no-cache
with response.removeHeader("Pragma")
on my interceptor seems to have failed and i’m not sure why. That pragma prevents me from accessing my saved cache for offline work.
can someone give light to this?
Issue Analytics
- State:
- Created 7 years ago
- Reactions:1
- Comments:5 (2 by maintainers)
Top GitHub Comments
@swankjesse just followed your advice instead. since http://www.jsonplaceholder.typicode.com is a free test rest api, it’s hard to play around with its server responses. I switched to www.mocky.io instead where i can modify server response codes/headers.
There might be something that’s preventing me from removing the “Pragma” header as i’m trying these out.
You can close the issue. Thank you.
Could you provide a complete executable test case? As is it’s unclear where the problem is.