Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4329902
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T09:53:13+00:00 2026-05-21T09:53:13+00:00

I want to use server cache for 15 minutess so what i have to

  • 0

I want to use server cache for 15 minutess so what i have to use in setRequestProperty() ?

Please Help me..

Here is my code which i used..

private HttpURLConnection httpCon = null;
httpCon = (HttpURLConnection) httpUrl.openConnection();
httpCon.setRequestMethod("GET");
httpCon.setRequestProperty("Connection", "Keep-Alive");
httpCon.setRequestProperty("Pragma","public");
httpCon.setRequestProperty("Cache-Control","maxage=900");
httpCon.setUseCaches(true);
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-21T09:53:14+00:00Added an answer on May 21, 2026 at 9:53 am

    You are telling the server you are willing for it to cache responses, but there’s no guarantee that the server will do that or is enabled to do that (unless you control the server also and implement that).

    You can also try setting up an intermediate HTTP cache the client and server, such as a proxy cache such as Varnish, Pound, or Squid.

    Lastly, you can do browser caching on your own, which is supported the the Android java.net package but doesn’t have a default implementation. To do this:

    -Check out HttpURLConnection which details (in the “Response Caching” section) that you must implement ResponseCache and call setDefault.

    -Also check out ResponseCache Example which has examples of this, and something quirky to watch out for at the end (which may or may not still be true).

    Good luck!

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I use SQL Server 2008 R2 and have a table that I want no
i have a xampp server and when i want to use Mod_rewrite it redirects
I have a view in SQL Server 2008 that I want to use for
I want to use my server (where it's installed Varnished) to cache webpage of
I'm writing a simple C# program and want to use an SQL server to
I want to create a dynamic HTML5 canvas animation. This animation should use server
I want to use telnet to google mail server on linux. I want to
I want to use prosody or maybe another xmpp server to test my xmpp
I want to use a single Doctrine install on our server and serve multiple
I want to use show a Loading Image on the click of server side

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.