[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

djmc

1/9/2007 4:00:00 AM

Is there any reason to cache an aspx page that only has static text on it?
It doesn't make a db connection, but is accessed frequently. I use an aspx
page instead of an html page to inherit the theme and master page for the
website.

Thanks!
4 Answers

Manish Bafna

1/10/2007 4:42:00 AM

0

Hi,
One way to improve the performance of any Web application is to cache static
content in memory. Cached content is always returned faster than freshly
rendered content. However, the tradeoff is that cached content may become
stale. ASP.NET 1.x supports several kinds of caching including:

Page levelâ??Each page may be cached as a whole piece or based on the
parameters used to access the page. The cached page expires after a fixed
time.
Page fragmentâ??If the page was built with user controls (.ascx files), then
the user controls could be cached independently of the rest of the page
content.
Programmatic cachingâ??The developer could also cache objects thanks to the
cache API. The cache API offers the distinct advantage of providing a means
to create different types of dependencies for when the cache should be
flushed.

Hope this answers your query.

References :msdn site.

Thanks and Regards,
Manish Bafna.
MCP and MCTS.


"djmc" wrote:

> Is there any reason to cache an aspx page that only has static text on it?
> It doesn't make a db connection, but is accessed frequently. I use an aspx
> page instead of an html page to inherit the theme and master page for the
> website.
>
> Thanks!

djmc

1/10/2007 5:46:00 AM

0

Hi,

Thanks for the response, but that did not really answer the question I asked.

I have an aspx page that is not dynamic. It is not pulling from a database,
and there is no logic being performed. It simply displays static html that
almost never changes. Would it be smart to enable output caching on this
page?

Thanks

"Manish Bafna" wrote:

> Hi,
> One way to improve the performance of any Web application is to cache static
> content in memory. Cached content is always returned faster than freshly
> rendered content. However, the tradeoff is that cached content may become
> stale. ASP.NET 1.x supports several kinds of caching including:
>
> Page levelâ??Each page may be cached as a whole piece or based on the
> parameters used to access the page. The cached page expires after a fixed
> time.
> Page fragmentâ??If the page was built with user controls (.ascx files), then
> the user controls could be cached independently of the rest of the page
> content.
> Programmatic cachingâ??The developer could also cache objects thanks to the
> cache API. The cache API offers the distinct advantage of providing a means
> to create different types of dependencies for when the cache should be
> flushed.
>
> Hope this answers your query.
>
> References :msdn site.
>
> Thanks and Regards,
> Manish Bafna.
> MCP and MCTS.
>
>
> "djmc" wrote:
>
> > Is there any reason to cache an aspx page that only has static text on it?
> > It doesn't make a db connection, but is accessed frequently. I use an aspx
> > page instead of an html page to inherit the theme and master page for the
> > website.
> >
> > Thanks!

Manish Bafna

1/10/2007 12:08:00 PM

0

Hi,
Read following Lines:

One way to improve the performance of any Web application is to cache static
content in memory. Cached content is always returned faster than freshly
rendered content.

Cached content will be retreived from the browser cache.So obviously it will
be faster than freashly rendered page.

Another way you can improve performance of your static pages is by removing
white spaces(by using httpmodule) and thereby reducing page size and improve
the performance.

Removing white spaces can dramatically reduce the size of your pages. The
following sample table contains white spaces.
Copy Code
// with white space
<table>
<tr>
<td>hello</td>
<td>world</td>
</tr>
</table>

The following sample table does not contain white spaces.

Copy Code
// without white space
<table>
<tr><td>hello</td><td>world</td></tr>
</table>

Save these two tables in separate text files by using Notepad, and then view
the size of each file. The second table saves several bytes simply by
removing the white space. If you had a table with 1,000 rows, you could
reduce the response time by just removing the white spaces. In intranet
scenarios, removing white space may not represent a huge saving. However, in
an Internet scenario that involves slow clients, removing white space can
increase response times dramatically. You can also consider HTTP compression;
however, HTTP compression affects CPU utilization.

You cannot always expect to design your pages in this way. Therefore, the
most effective method for removing the white space is to use an Internet
Server API (ISAPI) filter or an HttpModule object. An ISAPI filter is faster
than an HttpModule; however, the ISAPI filter is more complex to develop and
increases CPU utilization. You might also consider IIS compression. IIS
compression can be added by using a metabase entry.



you can search on any search engine as to how to remove white spaces for
complete working code.

Hope this helps you out.

Thanks and Regards,
Manish Bafna.
MCP and MCTS.

"djmc" wrote:

> Is there any reason to cache an aspx page that only has static text on it?
> It doesn't make a db connection, but is accessed frequently. I use an aspx
> page instead of an html page to inherit the theme and master page for the
> website.
>
> Thanks!

djmc

1/10/2007 2:10:00 PM

0

Hi,

Those are some great tips! Thanks for pointing out the static page would be
cached in the browser and returned without a hit to the server. I wasn't
thinking about that. I'll also look up the white space removal. It sounds
like it could be worth doing on several of my databound pages and controls.

I really appreciate the info, thanks again!


"Manish Bafna" wrote:

> Hi,
> Read following Lines:
>
> One way to improve the performance of any Web application is to cache static
> content in memory. Cached content is always returned faster than freshly
> rendered content.
>
> Cached content will be retreived from the browser cache.So obviously it will
> be faster than freashly rendered page.
>
> Another way you can improve performance of your static pages is by removing
> white spaces(by using httpmodule) and thereby reducing page size and improve
> the performance.
>
> Removing white spaces can dramatically reduce the size of your pages. The
> following sample table contains white spaces.
> Copy Code
> // with white space
> <table>
> <tr>
> <td>hello</td>
> <td>world</td>
> </tr>
> </table>
>
> The following sample table does not contain white spaces.
>
> Copy Code
> // without white space
> <table>
> <tr><td>hello</td><td>world</td></tr>
> </table>
>
> Save these two tables in separate text files by using Notepad, and then view
> the size of each file. The second table saves several bytes simply by
> removing the white space. If you had a table with 1,000 rows, you could
> reduce the response time by just removing the white spaces. In intranet
> scenarios, removing white space may not represent a huge saving. However, in
> an Internet scenario that involves slow clients, removing white space can
> increase response times dramatically. You can also consider HTTP compression;
> however, HTTP compression affects CPU utilization.
>
> You cannot always expect to design your pages in this way. Therefore, the
> most effective method for removing the white space is to use an Internet
> Server API (ISAPI) filter or an HttpModule object. An ISAPI filter is faster
> than an HttpModule; however, the ISAPI filter is more complex to develop and
> increases CPU utilization. You might also consider IIS compression. IIS
> compression can be added by using a metabase entry.
>
>
>
> you can search on any search engine as to how to remove white spaces for
> complete working code.
>
> Hope this helps you out.
>
> Thanks and Regards,
> Manish Bafna.
> MCP and MCTS.
>
> "djmc" wrote:
>
> > Is there any reason to cache an aspx page that only has static text on it?
> > It doesn't make a db connection, but is accessed frequently. I use an aspx
> > page instead of an html page to inherit the theme and master page for the
> > website.
> >
> > Thanks!