Loading ...
Sorry, an error occurred while loading the content.

Re: IO Get

Expand Messages
  • irwin_a
    Thanks for contributing a nifty component. It seems I get the same results as before when using the Polling component where it returns the cached data. I am
    Message 1 of 7 , May 1, 2009
    • 0 Attachment
      Thanks for contributing a nifty component. It seems I get the same results as before when using the Polling component where it returns the cached data. I am accessing a file that does not have any headers so my "modified" handler gets called at every interval, but with the same data from the first call.

      --- In yui3@yahoogroups.com, Eric Ferraiuolo <eferraiuolo@...> wrote:
      >
      > I wrote this component that works with YUI3: Smart
      > Polling<http://925html.com/code/smart-polling/>
      >
      >
      > Eric
      >
      > On Thu, Apr 30, 2009 at 5:01 PM, irwin_a <irwin_a@...> wrote:
      >
      > >
      > >
      > > I am using the Y.IO Get method to access an xml file on my local domain. I
      > > want to be able to access the file and look for new content at a set
      > > interval. I have no problem accessing the file. If I replace the contents or
      > > delete the xml file then I do not see the change when I access the file at
      > > the next interval. It is like the file is cached, because I still get back a
      > > success after the file has been deleted. I am using the default transport
      > > type not flash. Any ideas ??
      > >
      > >
      > >
      >
    • Eric Ferraiuolo
      When you said: an xml file on my local domain Are you using an HTTP server (http://localhost/) or the file-system (file:///)? It becomes much easier to deal
      Message 2 of 7 , May 1, 2009
      • 0 Attachment
        When you said:
         "an xml file on my local domain"

        Are you using an HTTP server (http://localhost/) or the file-system (file:///)?

        It becomes much easier to deal with file changes when you have valuable meta-data like Last-Modified and Etag headers. If you're accessing an HTTP server that should be no problem to enable (i.e. configuring a .htaccess file for Apache).


        On Fri, May 1, 2009 at 1:56 PM, irwin_a <irwin_a@...> wrote:


        Thanks for contributing a nifty component. It seems I get the same results as before when using the Polling component where it returns the cached data. I am accessing a file that does not have any headers so my "modified" handler gets called at every interval, but with the same data from the first call.


        --- In yui3@yahoogroups.com, Eric Ferraiuolo <eferraiuolo@...> wrote:
        >
        > I wrote this component that works with YUI3: Smart
        > Polling<http://925html.com/code/smart-polling/>
        >
        >
        > Eric

        >
        > On Thu, Apr 30, 2009 at 5:01 PM, irwin_a <irwin_a@...> wrote:
        >
        > >
        > >
        > > I am using the Y.IO Get method to access an xml file on my local domain. I
        > > want to be able to access the file and look for new content at a set
        > > interval. I have no problem accessing the file. If I replace the contents or
        > > delete the xml file then I do not see the change when I access the file at
        > > the next interval. It is like the file is cached, because I still get back a
        > > success after the file has been deleted. I am using the default transport
        > > type not flash. Any ideas ??
        > >
        > >
        > >
        >


      • Caridy Patino
        Hey Irwin, I don t think we need to use a polling approach for this particular use case. So, I will like to add an example for the approach described by
        Message 3 of 7 , May 1, 2009
        • 0 Attachment
          Hey Irwin,

          I don't think we need to use a polling approach for this particular use case. So, I will like to add an example for the approach described by Thomas:

          uri += ((uri.indexOf('?') == -1)?'?':'&') + "rnd=" + new Date().valueOf().toString();

          This code adds a timestamp to each request, avoiding cache.

          Best Regards,
          Caridy


          --- In yui3@yahoogroups.com, "tssha" <thomas.sha@...> wrote:
          >
          > --- In yui3@yahoogroups.com, "irwin_a" <irwin_a@> wrote:
          > >
          > > I am using the Y.IO Get method to access an xml file on my local domain. I want to be able to access the file and look for new content at a set interval. I have no problem accessing the file. If I replace the contents or delete the xml file then I do not see the change when I access the file at the next interval. It is like the file is cached, because I still get back a success after the file has been deleted. I am using the default transport type not flash. Any ideas ??
          >
          > If you are making a GET request, and you want to make subsequent requests to the same URI(without the browser providing a cached response), you will need to:
          >
          > - Submit the request with a randomised querystring(to defeat GET idempotency).
          >
          > or,
          >
          > - Serve cache-defeating headers in your response so the XML will not be cached by the client.
          >
          > Regards,
          > Thomas
          >
        • irwin_a
          Thanks to Thomas for the idea and you for the example. It seems to have resolved the issue I was having.
          Message 4 of 7 , May 1, 2009
          • 0 Attachment
            Thanks to Thomas for the idea and you for the example. It seems to have resolved the issue I was having.


            --- In yui3@yahoogroups.com, "Caridy Patino" <caridy@...> wrote:
            >
            > Hey Irwin,
            >
            > I don't think we need to use a polling approach for this particular use case. So, I will like to add an example for the approach described by Thomas:
            >
            > uri += ((uri.indexOf('?') == -1)?'?':'&') + "rnd=" + new Date().valueOf().toString();
            >
            > This code adds a timestamp to each request, avoiding cache.
            >
            > Best Regards,
            > Caridy
            >
            >
            > --- In yui3@yahoogroups.com, "tssha" <thomas.sha@> wrote:
            > >
            > > --- In yui3@yahoogroups.com, "irwin_a" <irwin_a@> wrote:
            > > >
            > > > I am using the Y.IO Get method to access an xml file on my local domain. I want to be able to access the file and look for new content at a set interval. I have no problem accessing the file. If I replace the contents or delete the xml file then I do not see the change when I access the file at the next interval. It is like the file is cached, because I still get back a success after the file has been deleted. I am using the default transport type not flash. Any ideas ??
            > >
            > > If you are making a GET request, and you want to make subsequent requests to the same URI(without the browser providing a cached response), you will need to:
            > >
            > > - Submit the request with a randomised querystring(to defeat GET idempotency).
            > >
            > > or,
            > >
            > > - Serve cache-defeating headers in your response so the XML will not be cached by the client.
            > >
            > > Regards,
            > > Thomas
            > >
            >
          Your message has been successfully submitted and would be delivered to recipients shortly.