[Zoo-discuss] WPS Caching

Farkas H farkas.dus at gmail.com
Tue Mar 26 22:28:44 PDT 2013


Hi all,

I want to invite you to a caching discussion.

Zoo-WPS implements a simple caching mechanism to store the responses
of referenced WFS-requests.
Advantage: better performance
Downside: not OGC-compliant

Why is the solution not OGC-compliant?
An OGC-compliant service has to be stateless. This means, the service
has to delete all intermediate results before it finishes.
Even if we would delete the cache files at the end of the process, the
service wouldn't be OGC-compliant either. The reason is: Any other
parallel running service could access the cache files.

What does this mean?
OGC-compliance makes caching more difficult. Each process has to deal
with intermediate results in its own environment or workspace.
Caching is only beneficial when a (chained) process requires the same
data more than once.


How can we achieve caching and OGC-compliance?
I have two alternatives for discussion.

(1)
We make the names of the cache files unique by adding a kind of sessionID.
I've tested using the following algorithm:
sessionID [millisec] = Unix-time [sec] * 1000 + CPU-clocks since start
of the process [millisec].
The algorithm should compute pretty unique values.
This will lead to the following file names: sessionID_md5Hash

The first time the service requests WFS-data, the data is not in the cache.
There is no cache file with the combination of sessionID and md5 hash.
The data has to be retrieved from the server.
Next time the service requests the same data, the data is already in
the file cache.
At the end of the process all cache files will be deleted.


(2)
We use the maps to store the results.
I've tested this for in and out using the follwing values:
name: md5 hash of the request
value: data of the response
If we use the maps, we don't have to make the names unique, because
another WPS-service can't access the maps. Hope I am right.
I found out that the service requires the cache files even if the
parameter "cacheDir" is not set in main.cfg. We have to change this
mechanism. Hope I am right again.


It would be nice if you could tell me your opinion about the
OGC-compliance and for the two caching variants.


Thank you for your time and response.

Regards,
Farkas


More information about the Zoo-discuss mailing list