4

So I'm running nightly tasks to generate some custom statistics for my site and copy the statistics in .csv format to separate server via SCP. Then I use these .csv files in Google Sheets to display them in table format.

The problem is, though, that each time I load the .csv file I need to give that spreadsheet "hard refresh" so it wouldn't use "cached" browser data when displaying the .csv file.

Is there a possibility to refresh the data each time opening the document?

2
  • how do you import the .csv into the spreadsheet? ('importdata'?) – akira Jul 6 '10 at 13:37
  • yes, it's import data. – Eimantas Jul 7 '10 at 3:51
2

i would suspect that setting the expire-time for the .csv file could help. that would be something for the server to deliver.

OR you can trick the webbrowser by appending something random at the end of the url you are using to fetching the data (see my comment on your question):

http://example.com/myfile.csv?_invalidate_cache_of_browser_XYZ

and then you have to put some random XYZ into the url, maybe by usuing the rand() function.

1
  • so, that worked? – akira Jul 7 '10 at 5:02
1

Unfortunately the solution suggested by akira doesn't always work. Google will not republish the Spreadsheet data immediately until the next "publish" cycle. So what this means is that it is not a browser caching issue.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.