@ SathMk
I suggest you not to ignore any tag Cache-Control Header , if you really wish to Cache image longer when the header say no-cahce , then you can trick to increase the max-age if it is non-zero like in your cache. Other wise you wont get cache working properly for data request .
if (headerValue != null) {
hasCacheControl = true;
String[] tokens = headerValue.split(",");
for (int i = 0; i < tokens.length; i++) {
String token = tokens[i].trim();
if (token.equals("no-cache") || token.equals("no-store")) {
//Check if no-cache is there then still check again the max-age
if (token.startsWith("max-age=")) {
try {
maxAge = Long.parseLong(token.substring(8));
} catch (Exception e) {
return null;
}
}
} else if (token.startsWith("max-age=")) {
try {
maxAge = Long.parseLong(token.substring(8));
} catch (Exception e) {
}
} else if (token.equals("must-revalidate") || token.equals("proxy-revalidate")) {
maxAge = 0;
}
}
}
Check if no-cache is there then still check again the max-age