Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP General > how to use cache ?

Reply
Thread Tools

how to use cache ?

 
 
dave
Guest
Posts: n/a
 
      05-24-2005
hi
I'm building a page that displays all phone in phoneview.asp...however from admin section we can add new phone image tht stores path in database.
I wanna use cache object in phoneview.asp..becoz most of the time images r same..
so i just need to store image in cache...but not data..becoz asp page reads all phone list information from database and displays all phones...
so is it possible to store image in cache so it can be served quickly if its in list...
any help would be appreciated...
thanx in advance...
dave
 
Reply With Quote
 
 
 
 
Roland Hall
Guest
Posts: n/a
 
      05-24-2005
"dave" wrote in message news:(E-Mail Removed)...

*looking at the subject" My ex can tell ya' how to do that. So can her
attorney.

: I'm building a page that displays all phone in phoneview.asp...however
from admin section we can add new phone image tht stores
: path in database.
: I wanna use cache object in phoneview.asp..becoz most of the time images r
same..
: so i just need to store image in cache...but not data..becoz asp page
reads all phone list information from database and displays all
: phones...
: so is it possible to store image in cache so it can be served quickly if
its in list...

Are you referring to preloading images into cache?

--
Roland Hall
/* This information is distributed in the hope that it will be useful, but
without any warranty; without even the implied warranty of merchantability
or fitness for a particular purpose. */
Technet Script Center - http://www.microsoft.com/technet/scriptcenter/
WSH 5.6 Documentation - http://msdn.microsoft.com/downloads/list/webdev.asp
MSDN Library - http://msdn.microsoft.com/library/default.asp


 
Reply With Quote
 
 
 
 
dave
Guest
Posts: n/a
 
      05-24-2005
I'm not sure..
I need sth like when you hit page and image is available in cache it shuld
display from cache rather than downloading from web server...
i m displaying 50 phone images on page...so each time its downloading from
web server...and takes bit long...
i dont know abt preloading images into cache...
just wanna know whats the best way to do it..
thnx
dave

"Roland Hall" <nobody@nowhere> wrote in message
news:(E-Mail Removed)...
> "dave" wrote in message news:(E-Mail Removed)...
>
> *looking at the subject" My ex can tell ya' how to do that. So can her
> attorney.
>
> : I'm building a page that displays all phone in phoneview.asp...however
> from admin section we can add new phone image tht stores
> : path in database.
> : I wanna use cache object in phoneview.asp..becoz most of the time images
> r
> same..
> : so i just need to store image in cache...but not data..becoz asp page
> reads all phone list information from database and displays all
> : phones...
> : so is it possible to store image in cache so it can be served quickly if
> its in list...
>
> Are you referring to preloading images into cache?
>
> --
> Roland Hall
> /* This information is distributed in the hope that it will be useful, but
> without any warranty; without even the implied warranty of merchantability
> or fitness for a particular purpose. */
> Technet Script Center - http://www.microsoft.com/technet/scriptcenter/
> WSH 5.6 Documentation -
> http://msdn.microsoft.com/downloads/list/webdev.asp
> MSDN Library - http://msdn.microsoft.com/library/default.asp
>
>



 
Reply With Quote
 
Roland Hall
Guest
Posts: n/a
 
      05-24-2005
"dave" wrote in message news:(E-Mail Removed)...
: I'm not sure..
: I need sth like when you hit page and image is available in cache it shuld
: display from cache rather than downloading from web server...
: i m displaying 50 phone images on page...so each time its downloading from
: web server...and takes bit long...
: i dont know abt preloading images into cache...
: just wanna know whats the best way to do it..

Ok, well you can wrap it in server-side script but I think this is
considered a client-side issue.

The way I understand it is when a page loads, the browser will render
elements that display on screen. So, if you have images, they will load one
at a time and if the user is on a dialup, they may see the image being drawn
as it is loaded. Obviously a high speed connection this is less noticeable.

When you reload a page that has already downloaded these images, they all
appear to load at once or "blink" on as people call it. The reason for this
is because the file is stored locally on the user's system in cache which
MSFT calls Temporary Internet Files. To get this same effect every time,
developers have figured out a way to preload the images before they appear
so when called for them on the page, they appear immediately.

I have a pretty elaborate preload routine but it can be as simple as this:

<script type="text/javascript">
// preload images into cache
if(document.images) {
var img1 = new Image();
img1.src = '/images/image1.jpg';
var img2 = new Image();
img2.src = '/images/image2.jpg';
}
function showImages() {
// display images on screen
document.getElementById('img1').src=img1.src;
document.getElementById('img2').src=img2.src;
}
</script>
</head>
<body onload="showImages()">
<img id="img1" src="" /><br />
<img id="img2" src="" /><br />

--
Roland Hall
/* This information is distributed in the hope that it will be useful, but
without any warranty; without even the implied warranty of merchantability
or fitness for a particular purpose. */
Technet Script Center - http://www.microsoft.com/technet/scriptcenter/
WSH 5.6 Documentation - http://msdn.microsoft.com/downloads/list/webdev.asp
MSDN Library - http://msdn.microsoft.com/library/default.asp


 
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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: How include a large array? Edward A. Falk C Programming 1 04-04-2013 08:07 PM
ASP.NET Cache vs Window System Cache Sergey via DotNetMonster.com ASP .Net 0 11-15-2006 03:33 PM
client-side cache vs server-side cache vs ajax vs asp.net callback =?Utf-8?B?b25l?= ASP .Net 1 03-08-2006 12:25 PM
Page.Cache vs HttpContext.Current.Cache DesignerX ASP .Net 5 01-20-2004 10:55 PM
Cache::Cache Stale Segments Jeff Nokes Perl 0 09-30-2003 04:34 PM



Advertisments