mnoGoSearch 3.2.39 reference manual: Full-featured search engine software
Prev | Chapter 3. Indexing | Next

# Storing cached copies

Since mnoGoSearch version 3.2.2, it is possible to store compressed copies of the indexed documents, so called cached copies. Cached copies are stored in the same SQL database.

If cached copies creation is active, then one can open the cached copy in the browser during search time. The cached copy is especially useful if the site's server is temporarily down or the page does not exist any longer.

Since mnoGoSearch version 3.2.4 cached copies are also used to produce documents excerpts for search results.

Cached copies are displayed by means of the `search.cgi` CGI script, executed with a special HTTP query string parameters. `search.cgi` fetches a cached copy of the document from the SQL database, then the document is displayed in your web browser, with search keywords highlighted.

To enable cached copies support, compile mnoGoSearch with zlib support:

         ./configure --with-zlib <other arguments>

## Configuring cached copies

To start using cached copies, please do the following:

Open `/usr/local/mnogosearch/etc/indexer.conf` in your favorite text editor and add this line:

`Section CachedCopy 0 64000`

where 64000 is maximum compressed cached copy size. If after compression a document's cached copy size is bigger than this number, then the cached copy is not stored. You can change this number according to your needs and your SQL database features.

## Using cached copies at search time

To enable displaying cached copies during search time, do the following:

- Make sure you have a cached copy link in your `search.htm` <!--res--> section: e.g. <A HREF="$(stored_href)">Cached copy</A> . You may take a look into default search template search.htm-dist to see an example.

- Optionally specify an alternative `search.cgi` URL in your `search.htm`. By default $(stored_href) will refer to the same search.cgi. However it is possible to reside displaying cached copies under another location, and even on another physical machine thus distributing CPU load. In this case you can specify another URL by adding the following line to `search.htm` variables section:

  `StoredocURL /path/to/another/search.cgi`

  Or an absolute path:

  `StoredocURL http://servername/path/to/search.cgi`

After cached copies have been configured, it works in the following order during search time:

1. For each document a link to its cached copy is displayed;

2. When the user clicks the link, `search.cgi` is executed. It sends a query to the SQL database and fetches the cached copy content.

3. `search.cgi` decompresses the requested cached copy and sends it to the web browser, highlighting the search keywords using the highlighting method given in HlBeg and HlEnd commands;

Prev | Home | Next
Disabling Apache logging | Up | mnoGoSearch HTML parser