473,809 Members | 2,775 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 1711
"dave" wrote in message news:ue******** ******@TK2MSFTN GP14.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******** ******@TK2MSFTN GP09.phx.gbl...
"dave" wrote in message news:ue******** ******@TK2MSFTN GP14.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******** ******@tk2msftn gp13.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.ima ges) {
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.getEle mentById('img1' ).src=img1.src;
document.getEle mentById('img2' ).src=img2.src;
}
</script>
</head>
<body onload="showIma ges()">
<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.net REMOVE> wrote in message news:ue******** ******@TK2MSFTN GP14.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
2856
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 expire in 5 minutes like so. If Not IsPostBack Then BindMyDropDown() Else Response.Write("<hr>Cache Expires 5 minutes" &
5
1738
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 and look into the Application Cache settings. I found a good article here: http://www.developer.com/net/net/article.php/1477771
14
2102
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 understand what the SetAllowResponseInBrowserHistory does. While researching caching I tried the code sample at the following page : http://msdn2.microsoft.com/library/97wcd0a4(en-us,vs.80).aspx
1
2730
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?). Global.asax.cs creates it in Application_Start, initializes it and places it in the cache. During initialization, CacheLogic retrieves data from the DB logic layer and caches it with removal callbacks set. Whenever an object in the business logic layer...
13
2353
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 cache using a sliding timeout and a dependency on the text file its data is extracted from. If it's relevant, based on current statistics, I do not expect more than about 400 people to be accessing the web site at the same time. I've seen it appears...
26
6283
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 the shared_buffers setting. I invite any corrective or confirming feedback. I realize there are many other hugely important performance factors outside this scope. One key aspect of pgsql performance tuning is to adjust the memory ...
18
9162
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 that nothing is cached and nothing is writen to disk.
0
2317
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 just fine, but when a use a Microsoft.ApplicationBlocks.Cache.dll created on Release mode, the client doesn't work no more, and I get this error message: ********************************************* 1) Exception Information...
5
2130
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); I don't know which namespace to use.
0
1982
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 work fine with some tweaking. But when the setup project is migrated to 2.0 the installation gives the follwing error: - <ExceptionInformation> <AdditionalInformationProperty ExceptionManager.MachineName="TestDev"...
0
9721
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9601
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10635
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10376
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
10115
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7653
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
1
4332
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3861
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3013
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.