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 3618720
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T22:47:19+00:00 2026-05-18T22:47:19+00:00

I have a Google App Engine servlet, it’s supposed to go to my site

  • 0

I have a Google App Engine servlet, it’s supposed to go to my site and get a file, then display the content of that file on the servlet served page, the code looks like this :

public class My_Servlet extends HttpServlet
{
  public void init(ServletConfig config) throws ServletException
  {
    super.init(config);
    System.gc();
  }

  public void doGet(HttpServletRequest request,HttpServletResponse response) throws IOException
  {
    PrintWriter out=response.getWriter();
    response.setContentType("text/html");
    out.println(getTextFile());
}

String getTextFile()
{
  String Text="";

  try
  {
    URL url=new URL("http://example.com/A_Dir/Test.txt");
    BufferedReader reader=new BufferedReader(new InputStreamReader(url.openStream()));
    String line;

    while ((line=reader.readLine())!=null) { Text+=line+"<Br>"; }
    reader.close();
  }
  catch (Exception e) {  }

  return Text;
}

It worked, but the problem is, after I changed the content in the file “Test.txt” on my site, the Google App is still displaying old data, I checked and double checked the file on my site, the old data is no longer there, and I thought every time I clicked the link served by the GAE, it will call getTextFile(), create the URL, go get the file and parse the lines, but it seems GAE is remembering old data from 3 days ago, and no matter how many times I refreshed the page or updated the GAE app and reloaded it on to the App Engine [and I can see the change made to the updated servlet], it’s still serving the more then 3 day old data, why? How to force it dynamically load that file?

  • 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-18T22:47:20+00:00Added an answer on May 18, 2026 at 10:47 pm

    GAE is caching the file. Try:

    URL url=new URL("http://mysite.com/A_Dir/Test.txt?r="+System.currentTimeMillis());
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a simple Google App Engine app, that I wrote using ordinary strings.
I'm using Google App Engine and Django templates. I have a table that I
I'm developing a simple servlet/JSP, data-driven web site on Google App Engine. I've started
I have a problem with the Google App Engine JDO implementation that I cannot
I have a Google App Engine application that performs about 30-50 calls to a
I have a Google App Engine datastore that could have several million records in
I have installed Google App Engine patch and I get the following error when
I have written a Google App Engine application that programatically generates a bunch of
I have a google app engine app that is using Django templates. I am
I have started to write app that can run on Google App Engine. But

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.