Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    How to force update of RSS feed

    As you'll recall, I fiddled with your RSS example and came up with:

    http://www.vashon.com/iso/RSS_portlets_JS2.html

    But the newsfeed content never changes. I can update the source feed file, and all a forced page refresh does is reload the SmartClient code.

    I have to go and dump all cached pages in the browser to get the lastest copy loaded.

    How do I, in SmartClient code, force a refresh on the source RSS feed?

    Thanks

    #2
    Hello flyarbo,

    The RSS feed in question is being served with HTTP "Expires" headers that instruct the browser to cache it for about two hours. You can verify this by going to directly to the RSS feed with Firefox and picking Tools > Page Info from the Firefox menus.

    That "Expires" setting is probably appropriate for production use. To forcibly bypass this for testing, you can add an arbitrary, always-unique parameter to the URL of the feed (in the code below I use the current timestamp). You will also want to invalidate the cache maintained by the ListGrid's ResultSet because it, too, is following the rules of HTTP caching. See the code below:

    Code:
    headlineGrid.data.invalidateCache()
    headlineGrid.fetchData({ ts : isc.timeStamp() });
    Make sense?

    Comment


      #3
      Perfect-o.

      Comment


        #4
        FYI:

        Using the:

        headlineGrid.data.invalidateCache()

        bit seems to leave no data in the headline grid.

        Using the:

        headlineGrid.fetchData({ ts : isc.timeStamp() });

        bit, by itself, seems to work spiffy.

        Comment

        Working...
        X