They say it cannot be done, true?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • News Reader

    #1

    They say it cannot be done, true?

    The default method of refreshing images is to
    append a "?" plus a random value to its URL.
    Then it should reload from the server without
    being fetched from the cache.

    Now, I have images to update which are
    generated by the server and this server won't
    accept any ?+numbers to be appended to
    the URLs, because this would cause a distortion
    of the submitted parameters. I was told that
    there is no solution to this problem, except to
    disable the browser's cache.

    Theoretically I could put every image to an
    iframe and use meta tags to have them
    periodically refreshed. But I don't like this
    approach, because this would make updating
    all the required parameters dynamically a
    headache.

    Does anyone have a better idea?



  • Matthew Lock

    #2
    Re: They say it cannot be done, true?

    Are you sure you can't just go:


    The server program generating the images would probably ignore any
    querystring parameters it's not expecting.

    Comment

    • Matthew Lock

      #3
      Re: They say it cannot be done, true?

      You could also experiment with appending extra path information to the
      url. Though IIS by default seems to choke on it, Apache seems fine:


      Comment

      • chotiwallah@web.de

        #4
        Re: They say it cannot be done, true?


        News Reader wrote:[color=blue]
        > The default method of refreshing images is to
        > append a "?" plus a random value to its URL.
        > Then it should reload from the server without
        > being fetched from the cache.
        >
        > Now, I have images to update which are
        > generated by the server and this server won't
        > accept any ?+numbers to be appended to
        > the URLs, because this would cause a distortion
        > of the submitted parameters. I was told that
        > there is no solution to this problem, except to
        > disable the browser's cache.
        >
        > Theoretically I could put every image to an
        > iframe and use meta tags to have them
        > periodically refreshed. But I don't like this
        > approach, because this would make updating
        > all the required parameters dynamically a
        > headache.[/color]

        try to randomize the image names
        micha[color=blue]
        >
        > Does anyone have a better idea?[/color]

        Comment

        • Randell D.

          #5
          Re: They say it cannot be done, true?

          News Reader wrote:
          [color=blue]
          > The default method of refreshing images is to
          > append a "?" plus a random value to its URL.
          > Then it should reload from the server without
          > being fetched from the cache.
          >
          > Now, I have images to update which are
          > generated by the server and this server won't
          > accept any ?+numbers to be appended to
          > the URLs, because this would cause a distortion
          > of the submitted parameters. I was told that
          > there is no solution to this problem, except to
          > disable the browser's cache.
          >
          > Theoretically I could put every image to an
          > iframe and use meta tags to have them
          > periodically refreshed. But I don't like this
          > approach, because this would make updating
          > all the required parameters dynamically a
          > headache.
          >
          > Does anyone have a better idea?
          >
          >
          >[/color]


          I'm still new to javascript but I think I'm getting to grips with it...
          But if I had that problem, then my work around (which may not work in
          100% all web browsers) would be to give all images a name... thus

          <img src=/image.jpg id="imagename" >

          Then I would perform a javascript routine to replace the image using the
          id tag as a reference using something like

          document.getEle mentById('image name').innerHTM L="<img src=/image2.jpg>";

          This routine could have an array containing image names which runs every
          x number of seconds, or on a mouse over or whatever...

          Would that help resolve your problem? Perhaps not - I'm thinking that
          your image names seem never to change... dunno... perhaps there is
          something there that will give you a work around, true?

          randelld

          Comment

          • News Reader

            #6
            Re: They say it cannot be done, true?

            Thanks guys for your posts.

            First of all - I guess I've found a solution:
            The server appears to accept "&rand=" plus
            a dummy parameter value. So I can go the
            usual approach mutating this value. (So
            Matthew's 1st post was on track.)

            Unfortunately this does not really satisfy
            my desire to use javascript to control
            if an image can be fetched from the cache
            or if it has to be reloaded from the server.

            Nevertheless, just some short replies
            to your posts:

            Matthew: Extra path info wom't work,
            but as mentioned "&rand=nnnn " is
            accepted.

            Micha & Randell D: The browser's cache
            seems to be compared just to the url
            which generates the server's response.
            There is no image name involved.


            Comment

            Working...