Web Developer's Virtual Library: Encyclopedia of Web Design Tutorials, Articles and Discussions


WDVL Newsletter

Active Server Pages
JSP/Java Servlets
Microsoft SQL Server
Daily Backup
Dedicated Servers
Streaming Audio/Video
24-hour Support    

jobs.webdeveloper.com

Hiermenus


e-commerce
Partner With Us















Developer Channel
FlashKit.com
JavaScript.com
JavaScriptSource
Developer Jobs
ScriptSearch
StreamingMediaWorld
Web Developer's Journal
Web Developer's Virtual Library
WebDeveloper.com
Webreference
Web Hosts
XMLfiles.com

internet.com
IT
Developer
Internet News
Small Business
Personal Technology

Search internet.com
Advertise
Corporate Info
Newsletters
Tech Jobs
E-mail Offers


The Final HTML

July 28, 2000

Now, the final html returned to the user is:

<title>Hello world</title>
<!-- my-style cached output (14:32) --//>
<font face=Arial size=2 color=yellow>
<!-- my-style end of output --//>
Hello world

You can endlessly expand on this model, adding modules is easy, as each module only has to conform to the calling convention my_modulename ($options) and return some html that can be replaced instead of the original call in the .my file.

Now, why would you do this? There are three important reasons:

  • caching
  • security
  • consistency

Caching

The parser optionally stores the output from the module in its cache directory. The next time someone calls <my-style name=test>, the parser checks if it can use the cached entry by checking on the expiration time of this particular entry. There is a default for all entries, but you can set it for each tag specifically by using the cache=x parameter:

		<my-style name=test cache=3600>

Now if there is a cached entry, it will only be used if it is not older than one hour. After this hour, the module will be called again and the newly returned html will update the cache entry.

You will not want to use the cache for all tags, but for e.g. database driven modules or modules that use an external webserver to retrieve information are likely to have a big performance penalty, so the caching might prove a big speedup here. Let alone when the underlying database or webserver is down, YOU then have a cached entry to serve!

Building your website with cached dynamic modules
Building your website with cached dynamic modules
Security


Up to => Home / Authoring / Languages / PHP / Dynamic_Modules




Jupiter Online Media: internet.comearthweb.comDevx.commediabistro.comGraphics.com

Search:

Jupitermedia Corporation has two divisions: Jupiterimages and Jupiter Online Media

Jupitermedia Corporate Info


Legal Notices, Licensing, & Permissions, Privacy Policy.

Web Hosting | Newsletters | Tech Jobs | Shopping | E-mail Offers