lizmap-web-client icon indicating copy to clipboard operation
lizmap-web-client copied to clipboard

Caching capabilities with PostgreSQL layer

Open Oxsw1ng opened this issue 1 year ago • 8 comments

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 :

  • Lizmap Web Client : 3.7.6
  • Lizmap plugin : 4.3.12
  • QGIS Desktop : 3.36.2
  • QGIS Server and plugins unknown status because the login provided is not an administrator
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

  • [ ] I have done the step just before in the Lizmap QGIS desktop plugin before opening this ticket. Otherwise, my ticket is not considered valid and might get closed.

Operating system

Debian 12

Browsers

Firefox

Browsers version

Firefox 126

Relevant log output

No response

Oxsw1ng avatar May 24 '24 14:05 Oxsw1ng

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)

Oxsw1ng avatar May 31 '24 12:05 Oxsw1ng

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.

gioman avatar Jun 14 '24 06:06 gioman

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.

Oxsw1ng avatar Jun 14 '24 09:06 Oxsw1ng

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.

gioman avatar Jun 14 '24 09:06 gioman

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.

Oxsw1ng avatar Jun 14 '24 09:06 Oxsw1ng

@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 avatar Jun 16 '24 09:06 gioman

@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).

gioman avatar Jun 16 '24 09:06 gioman

@gioman yeah you're right

Oxsw1ng avatar Jun 17 '24 07:06 Oxsw1ng