问题
I’m currently working with the Google Picasa API (C#) to display photos from public Picasa web album on my website.
The issue is that there is a delay (seconds to minutes) from the moment changes are done in web album to the moment it is reflected via API. I need it to be reflected immediately: When new photo is uploaded to the album I need it to be displayed on the same time exactly in the web site.
It got even more interesting when I found out changes are displayed without delay when entering the URL (http://picasaweb.google.com/data/feed/api/user//albumid/) to IE9 or Chrome.
I have also tried to call the above URL via HttpWebRequest and set all no-cache headers, but it didnt solve the issue.
So, what is the difference between browsers request to the request done by the HttpWebRequest/API on this case? Can anyone put me in the right direction?
Thanks
回答1:
Just in case you haven't found out and might still be interested, I had the exact same problem (though in PHP) and it turns out that anonymous requests are delayed, while authorized requests are instant. Because your browser contained a cookie with your Google account, it counted as an authorized request and therefore was instantly updated. However, the request by the code was still anonymous.
The solution would be to make an HTTP POST to retrieve the feed, and authorize the request as described here.
来源:https://stackoverflow.com/questions/11738778/how-to-avoid-delay-when-displaying-picasa-photos-using-picasa-api