473,666 Members | 2,039 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 1179
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*******@disc ussions.microso ft.com> wrote in message
news:9A******** *************** ***********@mic rosoft.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("S cripting.FileSy stemObject")
set fil = fso.CreateTextF ile(Server.MapP ath("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*******@disc ussions.microso ft.com> wrote in message
news:65******** *************** ***********@mic rosoft.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
1906
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 some processing... Serever.Transfer("second_page.aspx"); // or Response.Redirect("second_page.aspx"); same in
0
2131
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. After looking at the use of the OutputCache directive and tinkering with it a bit I found its usability.very limited. Think of it: it is okay for static content. Well that's nice but no big deal. Static content is cheap anyway, the file system...
0
1733
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 while to be processed. At the moment I have programmatic page caching in the "loader" using paramater caching to send a cached version of every requested page back to the user. How can I get particular elements inside each page to cache without...
3
1632
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 calculated on the fly when the request is made, and so I thought it would be ideal to cache the page for a set amount of time. I've placed the following at the top of my page: <%@ OutputCache Duration="160" VaryByParam="None" %> Now the problem is...
3
1263
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 (mysite/products-greenwidgets.aspx). then in the global.asax I intercept the url coming in and convert it to a parameter url like this (mysite/default.aspx?MenuID=greenwidgets). then when the default.aspx page loads, it passes "greenwidgets" to the database and gets a...
10
1463
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 anyway to cache the page without this happening or am I using Page Output caching in the wrong situation? It's a data entry web app that I'm trying to increase the performance on.
3
2479
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 want caching on. Is this doable? I think there is a config switch in 2.0, anything in 1.1? TIA for any hint,
3
2940
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 say “www.Test1.com” and “www.Test2.com” pointing to a single website. Website content is located onto UNCPath i.e. remote location. Domain 1: www.Test1.com points to \\servername\websitefolder\homedirectory
2
6102
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 simply be a result of being out of memory.) We're running on IIS 5.1 on a single Windows 2000 server. We have a separate database server - SQL Server 2000 64 bit. Session state is stored on the database.
4
2977
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... now I dont know if doing the PHP caching is worth the pain. Would there be any noticed performace improvement if I cache query results in PHP, considering that MySQL is already caching the queries? Thanks
0
8448
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, well explore What is ONU, What Is Router, ONU & Routers main usage, and What is the difference between ONU and Router. Lets take a closer look ! Part I. Meaning of...
0
8871
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
8783
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
8640
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...
0
7387
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development projectplanning, coding, testing, and deploymentwithout human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6198
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...
0
4198
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
2
2011
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1776
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.