Skip to content

Instantly share code, notes, and snippets.

@Malinskiy
Created June 23, 2018 01:52
Show Gist options
  • Save Malinskiy/c974c7b8c154beb018359437d51f9d92 to your computer and use it in GitHub Desktop.
Save Malinskiy/c974c7b8c154beb018359437d51f9d92 to your computer and use it in GitHub Desktop.
public Content get(final Context context) throws IOException {
Content content = maybeGetCachedContent(context);
Request request = context.getRequest();
if (request != null && request.getHeaders() != null && request.getHeaders().get("User-Agent") != null &&
request.getHeaders().get("User-Agent").startsWith("Nexus/")) {
request.getAttributes().set("DisableNegativeCache", true);
return null;
}
return doGet(context, content);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment