Questions tagged [httpresponsecache]
34 questions
2
votes
0 answers
Caching of HTTP responses (HttpResponseCache)
I'm trying to employ HttpResponseCache to cache each HTTP-request sent with HttpURLConnection.
But even if request goes to a resource 2'nd time the hit count always equals zero. Why it doesn't hit the cache?
Hit count:
import…

surlac
- 2,961
- 2
- 22
- 31
1
vote
1 answer
How to force caching with HttpsURLConnection and HttpResponseCache on Android?
I have the method below to request pages from wiktionary.org, the problem is that the server is returning Cache-control => private, must-revalidate, max-age=0 in the headers, which is preventing HttpsURLConnection from storing the requests.
Is there…

rraallvv
- 2,875
- 6
- 30
- 67
1
vote
2 answers
Android CacheResponse: get file path?
Is there a way to retrieve the file path of an Android CacheResponse? Sure, one can get an InputStream, but in cases where some API (e.g. NDK code) expects a file path that does not help. Sure one can use this stream to produce another file, but…

user6519354
- 169
- 1
- 7
1
vote
1 answer
HTTPResponseCache stores but never hits
I'm working on a application in Android which has a heavy load of web service requests.
I already have a LoginActivity in which the user introduces the username and the password and the server responses with the result and a token. Then, several…

Ignacio Ruiz
- 611
- 10
- 21
1
vote
0 answers
HttpResponseCache work with Image but not Json
I'm trying to use HttpResponseCache to enable the response caching (for web requests) . In My application, I execute the request by UrlConnection with Loader and then I sent InputStream result to the Activity to show image or work with JsonObject.…

AyumisLF
- 13
- 4
1
vote
1 answer
Handling Http 304 Response In Android
I am using HttpURLConnection for communication with server and using HttpResponseCache for caching, when server respond with 304 (HTTP_NOT_MODIFIED), i got empty body, but according to documentation of HttpURLConnection and HttpResponseCache, in…

kashif181
- 315
- 2
- 11
1
vote
1 answer
Android HttpResponseCache not working - FileNotFoundException
I have a problem caching http(s) responses from web server in Android, documentation is poor, so I'm asking for help here. Here's my code:
String encodedString = String.format("jsonData=%s", URLEncoder.encode(json, "UTF-8"));
URL urlConn =…

WildChild
- 93
- 7
1
vote
1 answer
How to use an installed HttpResponseCache
I've followed the developers guide and I've installed an HttpResponseCache by including the following code in the onCreate() method of my application:
try {
File httpCacheDir = new File(context.getCacheDir(), "http");
long httpCacheSize = 10 *…

kmon
- 67
- 5
1
vote
3 answers
HttpResponseCache doesn`t clear old files?
I will soon work on a project, which uses a lot of HTTPRequests for mainly JSONs and Images, so I thought it is a good idea to think about caching. Basically I'm looking for a solution for
Start a HTTPRequest with a given lifetime (f.e. 3,6,12…

longi
- 11,104
- 10
- 55
- 89
1
vote
0 answers
Caching of responses in HttpUrlConnection of android
In my app , i have implemented HttpResponseCache to cache the responses so that it could be used instead of hitting the server. For a particular api , the server returns the header Cache-Control as no-cache;must-revalidate. It has the header ETag…

Deepak Unnikrishnan
- 186
- 1
- 8
1
vote
1 answer
parsing Android HttpResponse cache update?
I am actually trying to enable HttpResponse cache in my android.so i 've enabled my cache in my main activty in the onCreate Method by calling this method:
private void enableHttpCaching()
{
if (Build.VERSION.SDK_INT >=…

Hadj Ali Oussama
- 784
- 2
- 8
- 29
1
vote
2 answers
NoClassDefFoundError in android 2.3.6 version(HttpResponseCahe)
I developed one Android app it's working fine in 4.0 and above but when it comes to version 2.3.4 it giving an exception about Responcecache. I followed according to github:- https://github.com/candrews/HttpResponseCache.I'm getting below an…

Bhargav Methuku
- 135
- 1
- 5
0
votes
1 answer
Does an HTTP request get cached when in the API ResponseCache NoStore = true? On a particular API endpoint
I'm looking through this documentation: Microsoft Documentation
What I read is that if response caching nostore attribute is set to true the server won't cache a response from that particular API endpoint. But what I'm wondering is what does it mean…

Rajivrocks
- 141
- 2
- 13
0
votes
0 answers
Subclassing com.android.okhttp.AndroidShimResponseCache in application
I want to subclass ResponseCache and use a subclass of com.android.okhttp.AndroidShimResponseCache as an internal delegate.
In particular I want to add a small pre-caching method to the class, similar to AndroidShimResponseCache.put, but with my…

Surya
- 11
- 2
0
votes
2 answers
com.squareup.okhttp.HttpResponseCache Cannot resolve symbol 'HttpResponseCache'
I'm trying to compile an Android project in Android Studio which imports:
com.squareup.okhttp.HttpResponseCache
I'm getting an error "Cannot resolve symbol 'HttpResponseCache' "
I've tried adding in the gradle the following dependencies without…

user3504453
- 1,541
- 1
- 10
- 10