Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP General > Cache?

Reply
Thread Tools

Cache?

 
 
Paulo
Guest
Posts: n/a
 
      10-16-2008
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!


 
Reply With Quote
 
 
 
 
Paulo
Guest
Posts: n/a
 
      10-17-2008
Many thanks Mr Barrows for the quick reply!

"Bob Barrows [MVP]" <(E-Mail Removed)> escreveu na mensagem
news:%231VhmU$(E-Mail Removed)...
> 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"
>



 
Reply With Quote
 
 
 
 
Bob Barrows [MVP]
Guest
Posts: n/a
 
      10-17-2008
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"


 
Reply With Quote
 
Anthony Jones
Guest
Posts: n/a
 
      10-17-2008


"Bob Barrows [MVP]" <(E-Mail Removed)> wrote in message
news:%231VhmU$(E-Mail Removed)...
> 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

 
Reply With Quote
 
Bob Barrows [MVP]
Guest
Posts: n/a
 
      10-17-2008
Anthony Jones wrote:
> "Bob Barrows [MVP]" <(E-Mail Removed)> wrote in message
> news:%231VhmU$(E-Mail Removed)...
>> 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"


 
Reply With Quote
 
Evertjan.
Guest
Posts: n/a
 
      10-17-2008
Anthony Jones wrote on 17 okt 2008 in
microsoft.public.inetserver.asp.general:

> "Bob Barrows [MVP]" <(E-Mail Removed)> wrote in message
> news:%231VhmU$(E-Mail Removed)...
>> 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...sp-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)
 
Reply With Quote
 
news.alltel.net
Guest
Posts: n/a
 
      10-17-2008
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." <(E-Mail Removed)> 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]" <(E-Mail Removed)> wrote in message
>> news:%231VhmU$(E-Mail Removed)...
>>> 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...sp-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)


 
Reply With Quote
 
Evertjan.
Guest
Posts: n/a
 
      10-17-2008
news.alltel.net wrote on 17 okt 2008 in
microsoft.public.inetserver.asp.general:

>
> "Evertjan." <(E-Mail Removed)> 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...y-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)
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off




Advertisments