473,387 Members | 1,453 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

how to use cache ?

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
Jul 22 '05 #1
4 1697
"dave" wrote in message news:ue**************@TK2MSFTNGP14.phx.gbl...

*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
Jul 22 '05 #2
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:Ov**************@TK2MSFTNGP09.phx.gbl...
"dave" wrote in message news:ue**************@TK2MSFTNGP14.phx.gbl...

*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

Jul 22 '05 #3
"dave" wrote in message news:ec**************@tk2msftngp13.phx.gbl...
: 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
Jul 22 '05 #4
Caching of images is done by the user's browser. It should happen automatically without you needing to worry about it (subject to the browser's configuration). So if its just images you are concerned about then don't worry about it, its the browsers responsibility not yours.

Brian.

www.cryer.co.uk/brian
"dave" <fo****@foo.netREMOVE> wrote in message news:ue**************@TK2MSFTNGP14.phx.gbl...
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
Jul 22 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: martin | last post by:
Hi, I am storing a dataset in cache, which is happening fine. I can easily retrive it at postback from the cache, cast it to a dataset and reuse it. However I have specified that the cache...
5
by: Darrel | last post by:
I thought this warranted a new thread. Yesterday I asked about access relatively static content...is it better to read from the DB, or just grab a text file. It was suggested that I use the DB...
14
by: Tom.PesterDELETETHISSS | last post by:
Hi, I think this question requires an in depth understanding of how a browser cache works. I hope I can reach an expert here. I may have found a quirk in the asp.net documentation or I don't...
1
by: William Sullivan | last post by:
I'm trying to nail down some issues with the cache in my application. Currently, I have an object that stands between my business logic and database logic called CacheLogic (cute, no?). ...
13
by: Andrew Morton | last post by:
I am caching some data in VB.NET using System.Web.Caching, is it possible to lock the cache so that other sessions attempting to access the same cache wait when it is being updated? I have the...
26
by: Ed L. | last post by:
Here's some of my current notions on pgsql performance tuning strictly as it relates to pgsql tuning parameters in the context of a dedicated linux or hpux server. I'm particularly focusing on...
18
by: siddharthkhare | last post by:
Hi All, what is the diference between these two cache control header. no-cache and no-store. I have read the w3.org explanation. So lets say I am using only no-cache ....my understanding is...
0
by: mateipuiu | last post by:
When a try to run a client build on 2005, which uses the Microsoft.ApplicationBlocks.Cache.dll reference, when using a Microsoft.ApplicationBlocks.Cache.dll created on Debug mode, the client works...
5
by: Stan SR | last post by:
Hi, Some newbie questions.. :-) First, what is the namespace to use for the Cache class ? When I use this bit of code I get an error if (Cache==null) Cache.Insert("myUserList",userlist);...
0
by: =?Utf-8?B?YmlqYXk=?= | last post by:
The type initializer for 'Microsoft.ApplicationBlocks.Cache.CacheService' threw an exception. We migrated our windows application from 1.1 to 2.0. The debug and Release mode of the application...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.