Prevent Caching on Google Visualization Query

100 views
Skip to first unread message

Nathan Jones

unread,
Apr 25, 2012, 4:07:12 PM4/25/12
to google-visua...@googlegroups.com
For a presentation I am working on, I would like to display live survey results from a Google Form. I am using the Google Visualization API and running the following query as a data source for a Chart:


The Chart is working perfectly using the data retrieved from the query, but the data from the query seems to be caching for around 30-60 seconds. Even though the actual spreadsheet has changed, Google responds with a "not modified" error. I have discovered that if you use the static image method of publishing a chart, the results are always live, but I would prefer to use the Visualization API.

Is there any way to prevent this caching and retrieve fresh data through the Visualization API Query? 

Viz Kid

unread,
Apr 30, 2012, 8:26:29 AM4/30/12
to google-visua...@googlegroups.com

Hi

The end of the url contains "&pub=1". This directs the query to the "published" version of the spreadsheet, which has some caching for the purposes of high query rate. For the purposes of a presentation (and not for exampling for publishing this chart on the web), you can try to remove the last part and it would probably remove this extra caching.

Hope this helps,
  Viz Kid

--
You received this message because you are subscribed to the Google Groups "Google Visualization API" group.
To view this discussion on the web visit https://groups.google.com/d/msg/google-visualization-api/-/FTekScG0zkwJ.
To post to this group, send email to google-visua...@googlegroups.com.
To unsubscribe from this group, send email to google-visualizati...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-visualization-api?hl=en.

Nathan Jones

unread,
Apr 30, 2012, 8:36:43 AM4/30/12
to google-visua...@googlegroups.com
Thats Perfect! 

That's exactly what I need for the presentation. We will be displaying it on the website later and I will be sure to use the caching, we shouldn't see very many simultaneous requests anyway.

Thanks again Viz Kid.

Nathan Jones | Business Analyst 
----------------------------------------------------


"Our City ~ Our Community ~ Our Cloud"

Reply all
Reply to author
Forward
0 new messages