MySpace Open Platform

A Place For Developers

Welcome Developers!

in

Welcome!

in

JS proxy cached in browser, missing ts/timestamp

Last post 04-17-2009 10:46 AM by Chad Russell. 4 replies.
Page 1 of 1 (5 items)
Sort Posts: Previous Next
  • 04-08-2009 11:52 AM

    • John
    • Top 75 Contributor
    • Joined on 02-27-2008
    • Posts 42

    JS proxy cached in browser, missing ts/timestamp

    I'm seeing a bug where some OpenSocial JS proxy requests are cached in my browser (IE, FF, and Safari).

    Upon inspecting these requests, I noticed that most of the time the "ts" (timestamp) parameter are not included, so naturally the browser caches the request.

    Filed under: , , ,
  • 04-08-2009 12:56 PM In reply to

    • John
    • Top 75 Contributor
    • Joined on 02-27-2008
    • Posts 42

    Re: JS proxy cached in browser, missing ts/timestamp

    By the way, the app I'm having problems with is 102843, My Top Artists.

    Here are some pages that exhibit the caching problem:

  • 04-08-2009 2:49 PM In reply to

    Re: JS proxy cached in browser, missing ts/timestamp

    Hi John,

    That's the correct behaviour.  For 0.7 apps we don't append a timestamp, it's up to the developer to determine whether they want the browser to cache the request or not.  You might be confusing this with API calls, for which we do append a timestamp.

    We incorrectly started appending a timestamp parameter for 0.8 makeRequest calls, but this can be removed via:

    var params = {}; 

    params[MyOpenSpace.RequestParameters.NO_TIMESTAMP] = true;

    What you're probably seeing is caused by the removal of the token from the query string on makeRequest calls, which was also breaking browser cache.  Details here:

    http://developer.myspace.com/Community/blogs/devteam/archive/2009/03/16/makerequest-token-changes.aspx

    In short, we're now correctly allowing developers themselves to determine whether they cache on the browser or not.  If you really don't want the browser to cache append a similar timestamp to your URLs, but browser caching, as I'm sure you're aware, can save a lot on bandwidth.

    Chad

  • 04-08-2009 3:12 PM In reply to

    • John
    • Top 75 Contributor
    • Joined on 02-27-2008
    • Posts 42

    Re: JS proxy cached in browser, missing ts/timestamp

    Thanks, Chad. Ideally, the browser cache should key off of the opensocial_owner_id (in my case at least). Would it be better to wait until after the "get owner" API call returns and include the owner id in the makeRequest URL or add a timestamp to every makeRequest call? The difference seems negligible.

  • 04-17-2009 10:46 AM In reply to

    Re: JS proxy cached in browser, missing ts/timestamp

     Hey John, really up to you.  The more that you can cache the better for both us and you though!

Page 1 of 1 (5 items)