How to avoid delay when displaying Picasa photos using Picasa API?

﹥>﹥吖頭↗ 提交于 2019-12-11 18:07:10

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!