Merge pull request #4271 from ByteHamster/disable-cache

Do not cache feeds
This commit is contained in:
H. Lehmann 2020-07-06 22:53:02 +02:00 committed by GitHub
commit 50178771dd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 1 deletions

View File

@ -65,11 +65,12 @@ public class HttpDownloader extends Downloader {
final URI uri = URIUtil.getURIFromRequestUrl(request.getSource()); final URI uri = URIUtil.getURIFromRequestUrl(request.getSource());
Request.Builder httpReq = new Request.Builder().url(uri.toURL()); Request.Builder httpReq = new Request.Builder().url(uri.toURL());
httpReq.tag(request); httpReq.tag(request);
httpReq.cacheControl(new CacheControl.Builder().noStore().build());
if (request.getFeedfileType() == FeedMedia.FEEDFILETYPE_FEEDMEDIA) { if (request.getFeedfileType() == FeedMedia.FEEDFILETYPE_FEEDMEDIA) {
// set header explicitly so that okhttp doesn't do transparent gzip // set header explicitly so that okhttp doesn't do transparent gzip
Log.d(TAG, "addHeader(\"Accept-Encoding\", \"identity\")"); Log.d(TAG, "addHeader(\"Accept-Encoding\", \"identity\")");
httpReq.addHeader("Accept-Encoding", "identity"); httpReq.addHeader("Accept-Encoding", "identity");
httpReq.cacheControl(new CacheControl.Builder().noStore().build());
} }
if (!TextUtils.isEmpty(request.getLastModified())) { if (!TextUtils.isEmpty(request.getLastModified())) {