3liz / lizmap-web-client

Transfer a QGIS project on a server, Lizmap is providing the web interface to browse it
https://www.lizmap.com
Mozilla Public License 2.0
261 stars 144 forks source link

Caching capabilities with PostgreSQL layer #4476

Open Oxsw1ng opened 6 months ago

Oxsw1ng commented 6 months ago

What is the question? (in English)

Hello ! To begin with, I'm sorry if I'm unclear about this issue, English is not my native language and I've started using Lizmap during my internship. So, I wanted to optimize my Lizmap project, because it was so slow, even with few layers. I wanted to try to use the server cache or the browser cache. I've unticked single tile and ticked Server tile cached for all my layers. When I now open my Lizmap project, I cant see that only one layer has a cache, which is an OpenStreetMap layer. The other ones are all vector layers. When I want to use php lizmap/console.php wmts:capabilities <repository> <project>, it only shows me the capabilities of the OSM layer. Now I still want to generate the cache for this layer, but when using php lizmap/console.php wmts:cache:seed <repository> <project> <myOSMlayer> <TileMatrixSet> <TileMatrixMin> <TileMatrixMax>, I get this for EACH tile :

Error, tile not cached

If I go into my cache repository, I can see a repository matching my repository and my project in Lizmap, and there is a repository for each layer. So, I don't have any hints to how to solve my problem because I've looked all issues already existing and I dont thing that someone already got this issue.

Environnement

LWC 3.7.6 QGIS Server 3.22.16 Lizmap Server 2.9.0 QGIS Desktop 3.36.2

Im using Apache as a server.

Versions, safeguards, check summary etc

Versions :

List of safeguards :
* Mode : safe * Allow parent folder : no * Prevent other drive : yes * Prevent PG service : yes * Prevent PG Auth DB : yes * Force PG user&pass : yes * Prevent ECW : yes

Check Lizmap plugin

Operating system

Debian 12

Browsers

Firefox

Browsers version

Firefox 126

Relevant log output

No response

Oxsw1ng commented 6 months ago

There's a little update about this !

So, as I can say after trying different solutions, PostGIS layers can't be saved in cache, but vector layers can. So I need to choose between the swiftness of Lizmap or the usability of Lizmap. So I dont know if you have some optimizations for PostGIS layers to make it faster ? (except some SQL requests improvments because it didn't made it faster for me)

gioman commented 5 months ago

PostGIS layers can't be saved in cache, but vector layers can.

@Oxsw1ng not sure I understand, can you elaborate? Sorry for asking, this is something that I think is also affecting me.

Oxsw1ng commented 5 months ago

PostGIS layers can't be saved in cache, but vector layers can.

@Oxsw1ng not sure I understand, can you elaborate? Sorry for asking, this is something that I think is also affecting me.

Hum if I understood well how caching works, you cant cache a Postgis layer, because when you generate capabilities for the project, you dont see the PostGis layers, which technically means you cant generate cache for it.
I think it can be explained because the PostGis layers are supposed to change often, so they decided to not activate caching on these layers.

gioman commented 5 months ago

because when you generate capabilities for the project, you dont see the PostGis layers

@Oxsw1ng I guess you mean this, right?

image

If the above script/command really does not list postgis layers I would assume that is a bug, I highly doubt that postgis layers were excluded by design.

Oxsw1ng commented 5 months ago

Yeah, this is what I meant. I cant really tell you if this is a bug or not, because I had so many issues concerning cache, but maybe you're right, it is.

gioman commented 5 months ago

@Oxsw1ng this adds up to my ticket https://github.com/3liz/lizmap-web-client/issues/3696 where I placed a few observations on caching along time, but that didn't get much attention.

gioman commented 5 months ago

@Oxsw1ng this should be reopened, it is a valid issue as there is no real reason why PostGIS layers should be cached (as PostGIS is one of the pillars for LMWC).

Oxsw1ng commented 5 months ago

@gioman yeah you're right