If you import live data into Google Docs spreadsheets using the importdata function and you want to force a refresh at a certain interval, but you also want to ensure that some cache-busting goes on, append a querystring that's the epoch time value that the refresh occurs, so for a sheet that should grab new data every hour you could force an update like this:
importData("http://example.com/data.csv?" & hour(googleclock()) & ")")
But the url requested looks like this: http://example.com/data.csv?11
if the refresh happened at 11am. The next day at 11, the url will be the same, so there's a chance you may get cached data. To get around this, use an epoch time-based refresh. The formula:
=((date(year(googleclock()),month(googleclock()),day(googleclock())) & " " & time(hour(googleclock()), 0, 0)) - DATE( 1970;1;1))*86400
gives you the epoch timestamp for the time at the current hour. If you wanted the timestamp for the current minute, you'd need to change time(hour(googleclock()), 0, 0)
to time(hour(googleclock()), minute(googleclock()), 0)
and then append it to your url as above:
importData("http://example.com/data.csv?" & ((date(year(googleclock()),month(googleclock()),day(googleclock())) & " " & time(hour(googleclock()), 0, 0)) - DATE( 1970;1;1))*86400 & ")")
The your requests will look like this: http://example.com/data.csv?1396440000
where the epoch-driven timestamp ensures that the cache busting always happens.
How to force Import refresh...
Thanks for this, but may be I'm wrong. Since the beginning of October 2015, the parsing with an URL concatenration is no longer supported. The turn arround solution could be a simple script and a trigger on this script. Here is the script working like a charm :
SpreadsheetApp.getActiveSpreadsheet().getSheetByName("Pricing").getRange('B184').setValue("https:/mywebsiteURL" + Utilities.formatDate(new Date(), "GMT", "yyyyMMddHHmmss"));
Hope this helps
Cheers,
Sébastien