WEB CACHE STATISTICS

4D - Documentation   Français   English   German   4th Dimension 2004, Command Theme List   4th Dimension 2004, Command Alphabetical List   4th Dimension 2004, Constant Theme List   Back   Previous   Next

version 6.5


WEB CACHE STATISTICS (pages; hits; usage)

ParameterTypeDescription
pagesText ArrayNames of the most consulted pages
hitsLongint ArrayNumber of hits for each page
usageNumberPercentage of the cache used

Description

The WEB CACHE STATISTICS command allows you to obtain information about the most consulted pages loaded in the Web server's cache. Consequently, these statistics only concern static pages, GIF pictures, JPEG pictures <100 KB and style sheets (.css).

Note: For more information about setting the 4D Web server's cache, please refer to section Web Server Settings.

The command fills the pages Text array with the names of the most consulted pages. The hits Longint array receives the number of "hits" for each page. The usage parameter receives the percentage of the Web cache used by each page.

Example

Let's assume that you want to generate a semi-dynamic page that displays the statistics of the Web cache. For this, in a static HTML page named "stats.shtm", you place the tag <!--4DACTION/STATS––>. Then you insert two 4D variables, vPages and vUsage.

In the project method STATS, you write the following code:

   C_TEXT ($1)
   ARRAY TEXT (pages;0)
   ARRAY LONGINT (hits;0)
   C_LONGINT (vUsage)

   WEB CACHE STATISTICS(pages;hits;vUsage)
   vPages:=Char(1)
   For ($i;1;Size of array(pages)) 
         ` For each page present in the cache
      vPages:=vPages+pages{$i}+"&nbsp;&nbsp;&nbsp;"+String(hits{$i})+"<br>"
         ` Insert the name of the page and the HTML code 
   End for
   SEND HTML FILE("stats.shtm")
      ` The contents of the pages with the suffix ".shtm" is always parsed

See Also

Information about the Web Site, Web Server Settings.


4D - Documentation   Français   English   German   4th Dimension 2004, Command Theme List   4th Dimension 2004, Command Alphabetical List   4th Dimension 2004, Constant Theme List   Back   Previous   Next