473,508 Members | 2,412 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Caching a page

Is there a way to cache an ASP page on the servers memory for a certain amount of time?
Jul 19 '05 #1
4 1171
Create an HTML page as output, and then replace it when your "cache" expires
(however you determine that)...

--
Aaron Bertrand
SQL Server MVP
http://www.aspfaq.com/


"joethis" <an*******@discussions.microsoft.com> wrote in message
news:9A**********************************@microsof t.com...
Is there a way to cache an ASP page on the servers memory for a certain

amount of time?
Jul 19 '05 #2
How do you do this?
Jul 19 '05 #3
joethis wrote:
Is there a way to cache an ASP page on the servers memory for a certain amount of time?

ASP pages _are_ cached on the server:
the first time an ASP page is requested, the source code is collected
(and cached), then compiled to bytecode and executed (and the bytecode
cached). See the details in Appendix 3 of
http://www.microsoft.com/technet/pro...on130121120120

Perhaps you wish to cache the _output_ of the ASP page (i.e., the HTML
that is produced by execution of that ASP page)? To do that, create a
program that writes the output to a .htm or .html file.
Jul 19 '05 #4
Well, you have an ASP page that you are running that does this, right?

response.write "<html>"
response.write "<body>"
response.write "Here is some content..."
....

So, instead, you do this:

set fso = CreateObject("Scripting.FileSystemObject")
set fil = fso.CreateTextFile(Server.MapPath("cache.htm"), true)
fil.writeline "<html>"
fil.writeline "<body>"
fil.writeline "Here is some content..."
fil.close
set fil = nothing: set fso = nothing

--
Aaron Bertrand
SQL Server MVP
http://www.aspfaq.com/

"joethis" <an*******@discussions.microsoft.com> wrote in message
news:65**********************************@microsof t.com...
How do you do this?

Jul 19 '05 #5

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

Similar topics

6
1892
by: Hypo | last post by:
Im relatilvly new to a web programming in general, and here's the situation i have: I have a default page with dynamic content, and one button with onclick code something like this: { // do...
0
2117
by: Martin | last post by:
Hi. I had a very frustrating afternoon and evening but I have got it all under control now so all of a sudden I am in a good mood. I want to share some insights on output caching with you lot. ...
0
1726
by: Troy Simpson | last post by:
Hi, I have a website which is made up of dynamic pages. Each page that's loaded has some code which looks at which template to load amongst other things, which causes the page to take a little...
3
1620
by: Janaka | last post by:
Hi All, I'm having a problem with Page Output caching on a page that contains a DataGrid. Basically the page pulls up some data for sales information from the DB. Some of this has to be...
3
1257
by: moondaddy | last post by:
I have a site where I have only one page and lots of user controls. Rather than passing parameters into the page (mysite/default.aspx?MenuID=123), I pass in a url like this...
10
1446
by: BillGatesFan | last post by:
I'm trying to understand ASP.NET caching. I set the Page Output directive to VaryByParams= None and the duration = 60. Now whenever users hit my web app they can see each others data. Is there...
3
2466
by: DC | last post by:
Hi, (ASP.Net 1.1) is it possible to (programmatically and globally) deactivate page fragment caching? We have only two scenarios, development stage where we want caching off and testing where we...
3
2932
by: Purti Malhotra | last post by:
Hi All, In our Web hosting environment we are using Virtual hosting i.e. multiple websites are on one server and multiple domains are pointing to a single website. Issue: We have two domains...
2
6084
by: George1776 | last post by:
All, I've recently upgraded our production ASP.NET/C# application from framework 1.1 to 2.0. Since then I've been plagued by out-of-memory errors and problems with the cache object (which may...
4
2964
by: Hermann | last post by:
My site is a bit slow showing the main page so I thought caching query result in PHP will improve performace. Then I read MySQL documentation and saw that MySQL does have a caching feature. So......
0
7223
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
7321
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,...
0
7377
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...
1
7036
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7489
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...
0
3191
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3179
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
762
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
414
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...

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.