Skip to content

Cache

Cached

When you run the server for the first time, the OpenAPI generator will validate your OpenAPI specification. This process can be take several minutes for long ontologies. Every time the server restart will trigger this process, which may be inconvenient if there are no new changes in the specification.

In order to speed up this process, the Python server generated by OBA creates a cache file of the specification, which avoid triggering the validation process if there are no new changes.

Docker

If you are using Docker, we recommend using volumes as follows:

$  docker run -v $PWD/openapi_server/openapi/:/usr/src/app/openapi_server/openapi/ <docker_image>

For example:

$  docker run -v $PWD/openapi_server/openapi/:/usr/src/app/openapi_server/openapi/ dbpedia_music
2020-05-23 00:23:54,109 - openapi_server.cached - WARNING - Cache file does not exist: [Errno 2] No such file or directory: '/usr/src/app/openapi_server/openapi/openapi.yaml.cache'
 * Serving Flask app "__main__" (lazy loading)
 * Environment: production
   WARNING: This is a development server. Do not use it in a production deployment.
   Use a production WSGI server instead.
 * Debug mode: off
2020-05-23 00:23:54,422 - werkzeug - INFO -  * Running on http://0.0.0.0:8080/ (Press CTRL+C to quit)

 ```

 ```bash
$  docker run -v $PWD/openapi_server/openapi/:/usr/src/app/openapi_server/openapi/ dbpedia_music
 * Serving Flask app "__main__" (lazy loading)
 * Environment: production
   WARNING: This is a development server. Do not use it in a production deployment.
   Use a production WSGI server instead.
 * Debug mode: off
2020-05-23 00:24:17,308 - werkzeug - INFO -  * Running on http://0.0.0.0:8080/ (Press CTRL+C to quit)
^C%