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

Re: [JavaScript] Caching .js files

Expand Messages
  • Keith Maika
    You could use JS to write the tag and add the current time to the URL so the browser things it s a different file. The better method though would be
    Message 1 of 4 , Dec 9, 2002
    • 0 Attachment
      You could use JS to write the <script> tag and add the current time to
      the URL so the browser things it's a different file. The better method
      though would be to get the server to send the approiate headers for
      cache control on the .js file. I'd know how to do it w/ php, not some
      other way though.

      nitedem0n wrote:
      > Is there anyway to stop the browser from caching external .js files?
      > I need the browser to downloaded the news .js file every time it
      > trys to load the page.
      >
      > -Aaron
      >
      >
      > To unsubscribe from this group, send an email to:
      > javascript_official-unsubscribe@yahoogroups.com
      >
      >
      >
      > Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service
      > <http://docs.yahoo.com/info/terms/>.
    • nitedem0n
      I m using a php script to generate the page that refers to the .js file so generating random tags isn t a problem. I guess i m not exactly sure what part of
      Message 2 of 4 , Dec 10, 2002
      • 0 Attachment
        I'm using a php script to generate the page that refers to the .js
        file so generating random tags isn't a problem. I guess i'm not
        exactly sure what part of the tag to change so it doesn't cache the
        file.

        There are also some static pages that refer to this .js file (it's
        not important if the file is cached on those pages) so I can't
        randomly change the name of the file either.

        -Aaron



        --- In javascript_official@yahoogroups.com, Keith Maika <slick@a...>
        wrote:
        > You could use JS to write the <script> tag and add the current
        time to
        > the URL so the browser things it's a different file. The better
        method
        > though would be to get the server to send the approiate headers
        for
        > cache control on the .js file. I'd know how to do it w/ php, not
        some
        > other way though.
        >
        > nitedem0n wrote:
        > > Is there anyway to stop the browser from caching external .js
        files?
        > > I need the browser to downloaded the news .js file every time it
        > > trys to load the page.
        > >
        > > -Aaron
        > >
        > >
        > > To unsubscribe from this group, send an email to:
        > > javascript_official-unsubscribe@yahoogroups.com
        > >
        > >
        > >
        > > Your use of Yahoo! Groups is subject to the Yahoo! Terms of
        Service
        > > <http://docs.yahoo.com/info/terms/>.
      • nitedem0n
        Nevermind. I figured it out. On the dynamically generated pages I just used php to add ?date after src file. Now it loads the script every time. -Aaron. ...
        Message 3 of 4 , Dec 10, 2002
        • 0 Attachment
          Nevermind. I figured it out. On the dynamically generated pages I
          just used php to add ?date after src file. Now it loads the script
          every time.

          -Aaron.


          --- In javascript_official@yahoogroups.com, nitedem0n
          <no_reply@y...> wrote:
          > I'm using a php script to generate the page that refers to the .js
          > file so generating random tags isn't a problem. I guess i'm not
          > exactly sure what part of the tag to change so it doesn't cache
          the
          > file.
          >
          > There are also some static pages that refer to this .js file (it's
          > not important if the file is cached on those pages) so I can't
          > randomly change the name of the file either.
          >
          > -Aaron
          >
          >
          >
          > --- In javascript_official@yahoogroups.com, Keith Maika
          <slick@a...>
          > wrote:
          > > You could use JS to write the <script> tag and add the current
          > time to
          > > the URL so the browser things it's a different file. The better
          > method
          > > though would be to get the server to send the approiate headers
          > for
          > > cache control on the .js file. I'd know how to do it w/ php,
          not
          > some
          > > other way though.
          > >
          > > nitedem0n wrote:
          > > > Is there anyway to stop the browser from caching external .js
          > files?
          > > > I need the browser to downloaded the news .js file every time
          it
          > > > trys to load the page.
          > > >
          > > > -Aaron
          > > >
          > > >
          > > > To unsubscribe from this group, send an email to:
          > > > javascript_official-unsubscribe@yahoogroups.com
          > > >
          > > >
          > > >
          > > > Your use of Yahoo! Groups is subject to the Yahoo! Terms of
          > Service
          > > > <http://docs.yahoo.com/info/terms/>.
        Your message has been successfully submitted and would be delivered to recipients shortly.