ESP8266HTTPClient - When I get, it seems like it's caching the data?

New here, but Arduino-ing for a while...

I'm stumped... I put a one line text file on a server hosted at Hostgator. Using a simple ESP8266 sketch I try to GET and display the contents of the file. It works!

But, if I FTP a new file to the server, the sketch loop keeps GETting the old text, like it's cached the way it would be in a browser.

I want to get the latest contents of the file.

Any thoughts as to how to "refresh" the data each time it's fetched using HTTPClient?

#include <ESP8266WiFi.h>
#include <ESP8266HTTPClient.h>

const char* ssid = "xxx";
const char* password = "xxx";
void setup () {
    WiFi.begin(ssid, password);
    while (WiFi.status() != WL_CONNECTED) {
void loop() {
    if (WiFi.status() == WL_CONNECTED) {
    HTTPClient http; 
    int httpCode = http.GET(); 
    if (httpCode > 0) {
           String payload = "";
           payload = http.getString();

I tried putting the WiFi.begin in the main loop so it would reconnect each time around, but no difference...

You are correct it is cached on the server. SWAG I have no sure way of clearing it but try this: to clear the cache is to disconnetc/connect again.

This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.