Gossamer Forum
Home : Products : Gossamer Links : Discussions :

Dynamic Page/Content Caching? (Application Acceleration)

Quote Reply
Dynamic Page/Content Caching? (Application Acceleration)
I'm thinking on a kind of page caching solution.
Before I describe the idea, let we see the other performance solutions.

Performance issues:
1) Of course performance is the best if the pages are rendered into static HTML, but the rendering time sometimes can take long (even very long) time, even if only the changed pages are rebuilt.
2) When we use dynamic page display, but we still need high performance, we can use permanent environment (mod_perl, FCGI, etc.). But even when using mod_perl, all the code flow, database queries, template parsing or compiled template file execution must be executed for each request.

It would be possible to cache a page within a relatively small time interval (i.e. 1 minute or 1 second depending on traffic size), and display the same cached page until it expires. This is usually called Dynamic Output Caching or Application Acceleration.
There are several solutions which I know to have such features, like:
http://www.pmachine.com/...general/caching.html (interesting idea: Query Caching, Tag Caching, Dynamic Page Caching)
http://www.warpsolutions.com/SiteMap/glossary.htm
http://www.zend.com/...nce-how-it-works.php
http://httpd.apache.org/docs/mod/mod_proxy.html


Using mod_proxy module in Apache would be a solution.
Also there is a plugin for LSQL, named Cache Page, which caches remote pages. However AFAIK it's caching remote pages, and I suppose it's not integrated into LSQL the way to cache internally generated pages.


Firstly: I'm looking for a solution, which can be easily integrated in shared virtual hosting environment, without serious changes in Apache config or in the server environment. Maybe something like mod_proxy.
Secondly: I'm looking for a solution within LinksSQL itself using a plugin, but the plugin should be capable to cache internally rendered dynamic pages. If there isn't such plugin, I'm thinking to create one in long terms, somewhere in the future. Or the author of Cache Page may implement that feature?

Ideas, advices, comments are welcome.
If you know other solutions than those mentioned above, let me know.

Best regards,
Webmaster33


Paid Support
from Webmaster33. Expert in Perl programming & Gossamer Threads applications. (click here for prices)
Webmaster33's products (upd.2004.09.26) | Private message | Contact me | Was my post helpful? Donate my help...
Quote Reply
Re: [webmaster33] Dynamic Page/Content Caching? (Application Acceleration) In reply to
Have you looked at the caching options from CPAN

Alex would have some insight into this, as well as what performance gains you might reasonably expect.

Without dedicated hardware caching, I'm not sure what performance boost you'd get.

Especially if you used "static" category pages, and dynamic->static detailed pages.

I think there was a search cache, which did do some improvement, as a search does take resources.


PUGDOG� Enterprises, Inc.

The best way to contact me is to NOT use Email.
Please leave a PM here.
Quote Reply
Re: [pugdog] Dynamic Page/Content Caching? (Application Acceleration) In reply to
It was good idea, to look at CPAN. I found CGI::Cache, which seems to do exactly the same thing I was looking for. Unfortunately until I don't use persistent environment, I will not gain too much from implementing it :(


Quote:
Without dedicated hardware caching, I'm not sure what performance boost you'd get.

Currently my goal is to improve performance by trading space for CPU resource.
Mod_perl would be the best choice for performance improvement later, but since now I'm on shared virtual hosting, it's not easy to convince my hosting service provider to configure mod_perl for me. Also there are some other reasons.

Likely a CGI independent solution will be usable for me, like mod_proxy, or similar solution (which caches the page as an intermediate layer, between page request & CGI script call).


Quote:
Especially if you used "static" category pages, and dynamic->static detailed pages.

I don't use detailed pages currently.
It's clear, that pure "static" category pages doesn't worth to be cached.
The only exception is, if I use SSI in HTML pages, especially if there are CGI scripts used as SSI input.


Any other comments? Any experience using mod_proxy? Any better choice than mod_proxy?

Best regards,
Webmaster33


Paid Support
from Webmaster33. Expert in Perl programming & Gossamer Threads applications. (click here for prices)
Webmaster33's products (upd.2004.09.26) | Private message | Contact me | Was my post helpful? Donate my help...
Quote Reply
Re: [webmaster33] Dynamic Page/Content Caching? (Application Acceleration) In reply to
Hello

I have CGI::Cache installed & there are examples of scripts in the README included.

It's not difficult, but you should edit the scripts to tell which routines to be cached.

To do such things for Links SQL is really a hel of a job.
There are hundreds of perl modules & editing them manually is not a good idea.


My question:

is there a perl module for Links SQL that tells CGI::Cache which routines from which modules should be cached?Unimpressed
Quote Reply
Re: [ericho] Dynamic Page/Content Caching? (Application Acceleration) In reply to
I believe, CGI::Cache unfortunately doesn't increase performance as much as mod_perl does.
So using mod_perl is better solution. Using mod_perl & CGI::Cache is another thing (but read below, that under mod_perl GT::Cache is used which does similar thing).

As for page caching, I think, you can not cache such parts of Links SQL, which are user based.
Mostly those pages are fine to be cached, does not have often changed parts (user information, etc.).

Quote:
There are hundreds of perl modules & editing them manually is not a good idea.

As for function caching, I think, there may be possible to use CGI::Cache within plugins. But that would need to replace (using plugin) many functions, methods, with your own CGI::Cache supported ones.
Big job, I think, and there are a lot potential bug changes, when you cache something, what shouldn't be cached. Also debugging of cached might be not too easy.

Quote:
is there a perl module for Links SQL that tells CGI::Cache which routines from which modules should be cached
Links SQL wasn't intended to work together with CGI::Cache.
But Links SQL has an internal module, named GT::Cache, which implements a simple function caching internally, but I didn't analyze how much GT::Cache is used. I'm sure tough, that GT::Cache is only used, when mod_perl is used.


Currently I think, that Apache's mod_proxy module will be the feature, that will be useful for me.

Best regards,
Webmaster33


Paid Support
from Webmaster33. Expert in Perl programming & Gossamer Threads applications. (click here for prices)
Webmaster33's products (upd.2004.09.26) | Private message | Contact me | Was my post helpful? Donate my help...