数据库缓存.aspx页面呈现的html [英] DB caching the html rendered by a .aspx page

查看:48
本文介绍了数据库缓存.aspx页面呈现的html的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述




我的目标是将整个html / javascript流吐出.aspx页面

并将它们保存为简单的字符串数据库(用于缓存目的)。


我不知道怎么能抓住这个html流,但是有没有人

有任何策略/代码样品让我走了?


谢谢,


JON


Hi,

My goal is to take the entire html/javascript stream spat out by .aspx pages
and save them as simple strings in a database (for caching purposes).

I''m not sure how I can get hold of this html stream, though - does anyone
have any strategies / code samples to get me going?

Thanks,

JON


推荐答案

沿着这些方向尝试一下。我没有测试过这个,但它应该指向

你朝正确的方向

受保护的覆盖子渲染(ByVal作为HtmlTextWriter)


Dim _stringBuilder As StringBuilder = New StringBuilder()

Dim _stringWriter As StringWriter = New StringWriter(_stringBuilder)

Dim _htmlWriter As HtmlTextWriter = New HtmlTextWriter(_stringWriter)

MyBase.Render(_htmlWriter)

Dim html As String = _stringBuilder.ToString()


''这里是你可以的地方操纵或保存html字符串


writer.Write(html)


结束子


Jon Maz <乔**** @ surfeu.de.no.spam>在消息中写道

新闻:好的************* @ TK2MSFTNGP12.phx.gbl ...
Try something along these lines. I haven''t tested this but it should point
you in the right direction
Protected Overrides Sub Render(ByVal writer As HtmlTextWriter)

Dim _stringBuilder As StringBuilder = New StringBuilder()
Dim _stringWriter As StringWriter = New StringWriter(_stringBuilder)
Dim _htmlWriter As HtmlTextWriter = New HtmlTextWriter(_stringWriter)
MyBase.Render(_htmlWriter)
Dim html As String = _stringBuilder.ToString()

''here is where you can manipulate or save the html string

writer.Write(html)

End Sub

"Jon Maz" <jo****@surfeu.de.no.spam> wrote in message
news:Ok*************@TK2MSFTNGP12.phx.gbl...


我的目标是通过.aspx
页面将整个html / javascript流吐出来并将它们保存为数据库中的简单字符串(用于缓存目的)。

我'我不知道如何抓住这个html流,但是有没有人有任何策略/代码示例让我去?

谢谢,
JON
Hi,

My goal is to take the entire html/javascript stream spat out by .aspx pages and save them as simple strings in a database (for caching purposes).

I''m not sure how I can get hold of this html stream, though - does anyone
have any strategies / code samples to get me going?

Thanks,

JON



你知道,ASP.NET的OutputCache指令是非常强大的并且做了什么

你在找。先检查一下。

" Jon Maz" <乔**** @ surfeu.de.no.spam>在消息中写道

新闻:好的************* @ TK2MSFTNGP12.phx.gbl ...
You know, ASP.NET''s OutputCache directive is VERY powerfull and does what
you are looking for. Check it out first.
"Jon Maz" <jo****@surfeu.de.no.spam> wrote in message
news:Ok*************@TK2MSFTNGP12.phx.gbl...


我的目标是通过.aspx
页面将整个html / javascript流吐出来并将它们保存为数据库中的简单字符串(用于缓存目的)。

我'我不知道如何抓住这个html流,但是有没有人有任何策略/代码示例让我去?

谢谢,
JON
Hi,

My goal is to take the entire html/javascript stream spat out by .aspx pages and save them as simple strings in a database (for caching purposes).

I''m not sure how I can get hold of this html stream, though - does anyone
have any strategies / code samples to get me going?

Thanks,

JON



大家好,


感谢您的回复。


我真的*需要将整个页面的html / javascript缓存到db -

页面涉及的页数太大而无法缓存在服务器内存中,这是

内置的asp.net缓存是什么(如果我理解的话)。所以它好像b $ b看起来我需要一些自定义解决方案(随意纠正我

如果我错了)。


该网站是一家出版公司,将使用内容管理系统将b * b
系统直接输入动态内容。当CMS用户(

记者)通过CMS创建新页面内容时,他应该有

选项立即缓存此新页面,即在任何网站用户之前已经

在浏览器中查看.aspx页面。


现在我真的不知道如何解决这个问题。一个aspx页面有一个公共的

RenderControl方法 - 我应该以某种方式使用它吗?


任何帮助表示赞赏,


干杯,


JON


PS我也不确定machine.config ProcessModel可以为我做什么

(Jayson在microsoft.public.dotnet.framework中提出的建议)。任何人都可以

阐明吗?


---

邮件已经过无病毒认证。

由AVG反病毒系统( http://www.grisoft.com)检查

版本:6.0.572 /病毒库:362 - 发布日期:27/01/2004
Hi All,

Thanks for the replies.

I really *do* need to cache entire pages of html/javascript to a db - the
number of pages involved is too great to cache in server memory, which is
what (if I understand correctly) the built-in asp.net caching does. So it
looks like I need some kind of custom solution here (feel free to correct me
if I''m wrong about this).

The site, which is for a publishing company, will use a Content Management
System to input dynamic content directly into the db. When the CMS user (a
journalist) is creating new page content via the CMS, he should have the
option to cache this new page immediately, ie before any site user has
viewed the .aspx page in a browser.

Now I''m really not sure how to go about this. An aspx page has a public
RenderControl method - should I be looking to use that somehow?

Any help appreciated,

Cheers,

JON

PS Also I''m not sure what the machine.config ProcessModel can do for me
(Jayson''s suggestion in microsoft.public.dotnet.framework). Can anyone
elucidate?

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.572 / Virus Database: 362 - Release Date: 27/01/2004


这篇关于数据库缓存.aspx页面呈现的html的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆