3liz / py-qgis-server

QGIS embbeded WMS/WFS/WCS asynchronous scalable http server
https://docs.3liz.org/py-qgis-server
Mozilla Public License 2.0
68 stars 16 forks source link

How to force py-qgis-server to not use cache for GetCapabilities request ? #60

Closed TANK2003 closed 1 year ago

TANK2003 commented 1 year ago

How to force py-qgis-server to not use cache for GetCapabilities request ? Or for all request if it is not possible

Thanks

dmarteau commented 1 year ago

Are you talking about the projects cache ? If you do not use project's cache , they will be reloaded at each request which will be a huge performance penalty.

You can always use a cache size of 1, but I don't see any reason to give up projects cache.

What problem are you trying to solve ?

TANK2003 commented 1 year ago

Re,

Description of the problem

So i'am tryng to regenerate getcapabilities request at each query

Maybe a solution ?

Maybe if i whrite a custom Loader schemes ? Where a projet will be the combination of project name &user connected ?

dmarteau commented 1 year ago

Yes i'am talking about the project Cache

Your question is about the GetCapabilities response, which is not related to project's cache.

As a matter of fact the capabilities document is not cached at all by the server, but use standard client cache headers:

Py-qgis-server return getcapabilities response with Etag headers, if the client request the same capabability document with a If-None-Match header with a matching Etag value then a 304 Not Modified is returned.

If you want the capabilities to be returned on each request, then bypass client cache Etag headers (from javascript, use non-cached fetch requests) , then the request will reach your plugin.

You may also disable etag generation on server side by disabling the TRUST_LAYER_METADATA option.

TANK2003 commented 1 year ago

Will try it known and give a feedback. Thanks !

TANK2003 commented 1 year ago

Hello, For all this i have disable the etag header on py-qgis-server.

I have try :

dmarteau commented 1 year ago

In debug mode, you must have something like:

test-py-qgis-server-qgis-server-1  | 2023-04-12 10:39:14,890    DEBUG   [31]    Qgis: Server: REQUEST:GetCapabilities
test-py-qgis-server-qgis-server-1  | 2023-04-12 10:39:14,890    DEBUG   [31]    Qgis: Server: SERVICE:WFS
...

The above tell you that the request has reached Qgis server instance. If you get this and your plugin is loaded then your plugin must be called. Otherwise there is something wrong with your plugin.

dmarteau commented 1 year ago

Alternatively you may setup the management server mode with the MANAGEMENT_ENABLED option.

Then go to http://localhost:19876/plugins to check the status of the plugins.

github-actions[bot] commented 1 year ago

This issue is stale because it has been open for 30 days with no activity.

github-actions[bot] commented 1 year ago

This issue was closed because it has been inactive for 14 days since being marked as stale.