caching images served by ASP

Ask a Question related to ASP, Design and Development.

  1. #1

    Default Re: caching images served by ASP

    Tim Williams wrote on 28 jun 2003 in
    microsoft.public.inetserver.asp.general:
    > It is pretty common to append a querystring to an image if you're
    > always using the same src and the <image> is changing, but this only
    > works if the querystring contains a random parameter value.
    Random does not prevent a repeating of a value.

    What it needs is a nonrepeating value,
    which could be simply an increasing value.

    In practice a simple pseudorandom value is easier on the web,
    because it precludes the storing of such value.
    That this goes wrong one in say 10,000 not many complaits will come in.
    Perhaps not good enoug for a banking site?
    > - the browser looks at the whole url and
    > [should] only re-fetch the image if the url changes (though
    > it may always do so, depending on the client-settings).
    Not exactly if I read you well. The querystring is part of the url in the
    desision whether to re-fetch or not-to-fetch. Otherwise this would go
    Hamlettian wrong:

    <img src="/getpicture.asp?picnr=7"><br>
    <img src="/getpicture.asp?picnr=14"><br>

    --
    Evertjan.
    The Netherlands.
    (Please change the x'es to dots in my emailaddress)
    Evertjan. Guest

  2. Similar Questions and Discussions

    1. index.cfm deleted, but still being served
      So I have an index.cfm that was deleted, yet the page is still being served. I doesn't exist at all on my server, yet I can still view it. I've even...
    2. loadMovie not caching images
      I am experiencing problems with Internet Explorer not caching image files that I am calling wi the loadMovie function Mozilla browsers seem to...
    3. ASP pages not being served correctly
      I have a new computer that I have iis 5 installed on win xp. I am trying to run a simple one line asp test file in my wwwroot directory. In IE 6...
    4. Help please... ASP is not served by IIS.
      http://www.aspfaq.com/2226 http://www.aspfaq.com/2147 "Dan" <dan@netgeekster.com> wrote in message...
    5. ASP Caching
      Hello, I have a simple web form page in which I insert/update data to a database. The SQL code to insert data is written in a server side submit...
  3. #2

    Default Re: caching images served by ASP

    Michael King wrote on 29 jun 2003 in
    microsoft.public.inetserver.asp.general:
    > imgs = new Array();
    > imgs[0] = new Image();
    > imgs[0].src = "binimage.asp?id=100"
    > imgs[1] = new Image();
    > imgs[1].src = "binimage.asp?id=101"
    > imgs[2] = new Image();
    > imgs[2].src = "binimage.asp?id=102"
    > ...
    >
    > This time, the when the prev function assigns an image from the array
    > into the IMG element, the browser re-requests the image from the
    > server.
    I never use a DB that way, so I cannot test it.

    Perhaps binimage.asp introduses a noncatching header ??

    [Or needs a catching header?]

    --
    Evertjan.
    The Netherlands.
    (Please change the x'es to dots in my emailaddress)
    Evertjan. Guest

  4. #3

    Default Re: caching images served by ASP

    Dear all

    Please accept my apology for this question - I have now sorted the issue out
    (thanks to a TCP/IP trace).

    It was due to invalid headers returned by my binimage.asp script which
    prevented the browser from caching the response.

    The fact the the browser still displays "downloading image ..." didn't help
    !

    "Michael King" <mzk_at_btopenworld.com> wrote in message
    news:On3pAqkPDHA.2244@TK2MSFTNGP11.phx.gbl...
    > I am not sure if I'm asking the right question, but the problem can be
    > demonstrated as follows:
    >
    > If I use client-side JavaScript to preload static images and allow the
    user
    > to browse through them, it works as expected:
    >
    > imgs = new Array();
    > imgs[0] = new Image();
    > imgs[0].src = "static0.png"
    > imgs[1] = new Image();
    > imgs[1].src = "static1.png"
    > imgs[2] = new Image();
    > imgs[2].src = "static2.png"
    > ...
    > function prev() {
    > if (i > 0) {
    > i--;
    > oImg.src = imgs[i].src;
    > }
    > }
    >
    > The activation of the prev function moves an image referenced in the imgs
    > array into the IMG element, without requesting the image data from the
    > server.
    >
    > However, when I use exactly the same code, but with images read from a DB,
    > it doesn't work:
    >
    > imgs = new Array();
    > imgs[0] = new Image();
    > imgs[0].src = "binimage.asp?id=100"
    > imgs[1] = new Image();
    > imgs[1].src = "binimage.asp?id=101"
    > imgs[2] = new Image();
    > imgs[2].src = "binimage.asp?id=102"
    > ...
    >
    > This time, the when the prev function assigns an image from the array into
    > the IMG element, the browser re-requests the image from the server.
    >
    > I have tried setting the expires and cachecontrol properties in the
    > binimage.asp script, but the images still don't cache !!
    >
    > If anyone can confirm that this is behaviour is by design, then please put
    > me out of my misery ;)
    >
    >

    Michael King Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139