Cache?

Discussion in 'ASP General' started by Paulo, Oct 17, 2008.

  1. Paulo

    Paulo Guest

    Hi, how do I force the asp to read the imgs files on server without making
    changings on IE settings like checking: Every visit on page...?

    Any hint? any classic asp code line?

    Thanks!
     
    Paulo, Oct 17, 2008
    #1
    1. Advertising

  2. Paulo

    Paulo Guest

    Many thanks Mr Barrows for the quick reply!

    "Bob Barrows [MVP]" <> escreveu na mensagem
    news:%231VhmU$...
    > Paulo wrote:
    >> Hi, how do I force the asp to read the imgs files on server without
    >> making changings on IE settings like checking: Every visit on page...?
    >>
    >> Any hint? any classic asp code line?
    >>

    > http://www.aspfaq.com/show.asp?id=2022
    >
    > --
    > Microsoft MVP - ASP/ASP.NET - 2004-2007
    > Please reply to the newsgroup. This email account is my spam trap so I
    > don't check it very often. If you must reply off-line, then remove the
    > "NO SPAM"
    >
     
    Paulo, Oct 17, 2008
    #2
    1. Advertising

  3. Paulo wrote:
    > Hi, how do I force the asp to read the imgs files on server without
    > making changings on IE settings like checking: Every visit on page...?
    >
    > Any hint? any classic asp code line?
    >

    http://www.aspfaq.com/show.asp?id=2022

    --
    Microsoft MVP - ASP/ASP.NET - 2004-2007
    Please reply to the newsgroup. This email account is my spam trap so I
    don't check it very often. If you must reply off-line, then remove the
    "NO SPAM"
     
    Bob Barrows [MVP], Oct 17, 2008
    #3
  4. "Bob Barrows [MVP]" <> wrote in message
    news:%231VhmU$...
    > Paulo wrote:
    >> Hi, how do I force the asp to read the imgs files on server without
    >> making changings on IE settings like checking: Every visit on page...?
    >>
    >> Any hint? any classic asp code line?
    >>

    > http://www.aspfaq.com/show.asp?id=2022
    >


    That article relates to the caching of responses from an ASP page. However
    the question really related to the caching of the imgs which are not
    normally served up by ASP. IOW this is an IIS question not a ASP one.

    The images should be placed in a common folder (or set of folders in a
    common root folder). In IIS manager open properties on the folder and go to
    the HTTP Headers tab. Turn on expiry and set to expiry today at midnight.
    Add a custom header Cache-Control: no-cache.

    That will sort the problems with cached images out.

    --
    Anthony Jones - MVP ASP/ASP.NET
     
    Anthony Jones, Oct 17, 2008
    #4
  5. Anthony Jones wrote:
    > "Bob Barrows [MVP]" <> wrote in message
    > news:%231VhmU$...
    >> Paulo wrote:
    >>> Hi, how do I force the asp to read the imgs files on server without
    >>> making changings on IE settings like checking: Every visit on
    >>> page...? Any hint? any classic asp code line?
    >>>

    >> http://www.aspfaq.com/show.asp?id=2022
    >>

    >
    > That article relates to the caching of responses from an ASP page. However
    > the question really related to the caching of the imgs which
    > are not normally served up by ASP. IOW this is an IIS question not a
    > ASP one.
    > The images should be placed in a common folder (or set of folders in a
    > common root folder). In IIS manager open properties on the folder
    > and go to the HTTP Headers tab. Turn on expiry and set to expiry
    > today at midnight. Add a custom header Cache-Control: no-cache.
    >
    > That will sort the problems with cached images out.


    My bad - I thought the article covered that. I should have reread it before
    posting it.


    --
    Microsoft MVP - ASP/ASP.NET - 2004-2007
    Please reply to the newsgroup. This email account is my spam trap so I
    don't check it very often. If you must reply off-line, then remove the
    "NO SPAM"
     
    Bob Barrows [MVP], Oct 17, 2008
    #5
  6. Paulo

    Evertjan. Guest

    Anthony Jones wrote on 17 okt 2008 in
    microsoft.public.inetserver.asp.general:

    > "Bob Barrows [MVP]" <> wrote in message
    > news:%231VhmU$...
    >> Paulo wrote:
    >>> Hi, how do I force the asp to read the imgs files on server without
    >>> making changings on IE settings like checking: Every visit on
    >>> page...?
    >>>
    >>> Any hint? any classic asp code line?
    >>>

    >> http://www.aspfaq.com/show.asp?id=2022
    >>

    >
    > That article relates to the caching of responses from an ASP page.
    > However the question really related to the caching of the imgs which
    > are not normally served up by ASP. IOW this is an IIS question not a
    > ASP one.
    >
    > The images should be placed in a common folder (or set of folders in a
    > common root folder). In IIS manager open properties on the folder and
    > go to the HTTP Headers tab. Turn on expiry and set to expiry today at
    > midnight. Add a custom header Cache-Control: no-cache.
    >
    > That will sort the problems with cached images out.


    Indeed "normally".
    But for the "admormal" that have no access to the IIS internals.

    To accomodate the latter the images could be called by the client from an
    nonexisting directory, and on arrival at 404.asp detected and streamed to
    the client after setting headers as in
    <http://classicasp.aspfaq.com/general/how-do-i-prevent-my-asp-pages-from-
    caching.html>


    Perhaps even a
    server.transfer "/realdir/myImage.jpg"
    is possible, but I never tested that.

    --
    Evertjan.
    The Netherlands.
    (Please change the x'es to dots in my emailaddress)
     
    Evertjan., Oct 17, 2008
    #6
  7. I don't have my code handy, but what I've done in the past is put a random
    number after the image so it's unique.

    <img src="\images\theImage.jpg?id=<%= random number here %>">

    Then the browser thinks it's a different image and won't pull it from the
    cache.

    Ron

    "Evertjan." <> wrote in message
    news:Xns9B3AA35BD924Deejj99@194.109.133.242...
    > Anthony Jones wrote on 17 okt 2008 in
    > microsoft.public.inetserver.asp.general:
    >
    >> "Bob Barrows [MVP]" <> wrote in message
    >> news:%231VhmU$...
    >>> Paulo wrote:
    >>>> Hi, how do I force the asp to read the imgs files on server without
    >>>> making changings on IE settings like checking: Every visit on
    >>>> page...?
    >>>>
    >>>> Any hint? any classic asp code line?
    >>>>
    >>> http://www.aspfaq.com/show.asp?id=2022
    >>>

    >>
    >> That article relates to the caching of responses from an ASP page.
    >> However the question really related to the caching of the imgs which
    >> are not normally served up by ASP. IOW this is an IIS question not a
    >> ASP one.
    >>
    >> The images should be placed in a common folder (or set of folders in a
    >> common root folder). In IIS manager open properties on the folder and
    >> go to the HTTP Headers tab. Turn on expiry and set to expiry today at
    >> midnight. Add a custom header Cache-Control: no-cache.
    >>
    >> That will sort the problems with cached images out.

    >
    > Indeed "normally".
    > But for the "admormal" that have no access to the IIS internals.
    >
    > To accomodate the latter the images could be called by the client from an
    > nonexisting directory, and on arrival at 404.asp detected and streamed to
    > the client after setting headers as in
    > <http://classicasp.aspfaq.com/general/how-do-i-prevent-my-asp-pages-from-
    > caching.html>
    >
    >
    > Perhaps even a
    > server.transfer "/realdir/myImage.jpg"
    > is possible, but I never tested that.
    >
    > --
    > Evertjan.
    > The Netherlands.
    > (Please change the x'es to dots in my emailaddress)
     
    news.alltel.net, Oct 17, 2008
    #7
  8. Paulo

    Evertjan. Guest

    news.alltel.net wrote on 17 okt 2008 in
    microsoft.public.inetserver.asp.general:

    >
    > "Evertjan." <> wrote in message
    > news:Xns9B3AA35BD924Deejj99@194.109.133.242...
    >> Anthony Jones wrote on 17 okt 2008 in


    [......]

    >>>
    >>> That article relates to the caching of responses from an ASP page.
    >>> However the question really related to the caching of the imgs which
    >>> are not normally served up by ASP. IOW this is an IIS question not
    >>> a ASP one.
    >>>
    >>> The images should be placed in a common folder (or set of folders in
    >>> a common root folder). In IIS manager open properties on the folder
    >>> and go to the HTTP Headers tab. Turn on expiry and set to expiry
    >>> today at midnight. Add a custom header Cache-Control: no-cache.
    >>>
    >>> That will sort the problems with cached images out.

    >>
    >> Indeed "normally".
    >> But for the "admormal" that have no access to the IIS internals.
    >>
    >> To accomodate the latter the images could be called by the client
    >> from an nonexisting directory, and on arrival at 404.asp detected and
    >> streamed to the client after setting headers as in
    >> <http://classicasp.aspfaq.com/general/how-do-i-prevent-my-asp-pages-fr
    >> om- caching.html>
    >>
    >>
    >> Perhaps even a
    >> server.transfer "/realdir/myImage.jpg"
    >> is possible, but I never tested that.


    [Please do not toppost on usenet and do not quote signatures]

    > I don't have my code handy, but what I've done in the past is put a
    > random number after the image so it's unique.
    >
    > <img src="\images\theImage.jpg?id=<%= random number here %>">
    >
    > Then the browser thinks it's a different image and won't pull it from
    > the cache.


    That is a not so nice [but useful] way, as you will fill up the browser
    cashe with lot's of versions of the same image.

    Anyway you do not need a random number, use the number of miliseconds
    since a fixed point in time. That is unique as it is nonrepeating.

    ASP Jscript:

    src="\images\theImage.jpg?id=<% = new Date() %>"




    --
    Evertjan.
    The Netherlands.
    (Please change the x'es to dots in my emailaddress)
     
    Evertjan., Oct 18, 2008
    #8
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Jeff Nokes

    Cache::Cache Stale Segments

    Jeff Nokes, Sep 30, 2003, in forum: Perl
    Replies:
    0
    Views:
    582
    Jeff Nokes
    Sep 30, 2003
  2. DesignerX

    Page.Cache vs HttpContext.Current.Cache

    DesignerX, Jan 20, 2004, in forum: ASP .Net
    Replies:
    5
    Views:
    8,268
    vMike
    Jan 20, 2004
  3. =?Utf-8?B?b25l?=
    Replies:
    1
    Views:
    5,300
    Karl Seguin [MVP]
    Mar 8, 2006
  4. Sergey via DotNetMonster.com

    ASP.NET Cache vs Window System Cache

    Sergey via DotNetMonster.com, Nov 15, 2006, in forum: ASP .Net
    Replies:
    0
    Views:
    481
    Sergey via DotNetMonster.com
    Nov 15, 2006
  5. John
    Replies:
    2
    Views:
    1,185
Loading...

Share This Page