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
257 stars 143 forks source link

Speed up rendering by caching images and not context #263

Open nboisteault opened 8 years ago

nboisteault commented 8 years ago

I think rendering could be speeded up by caching generated images and not serialized context files. In extra bonus we could then use better image compression than QGIS which has to compress on the fly.

rldhont commented 8 years ago

Images are cached if it's defined in configuration.

Can you be more explicit in the type of caching you'd like:

nboisteault commented 8 years ago

I mean server side cache. I see files like : /lizmap-web-client/cache/pnrlg/lizmap_pnr_lg/ABC_Enjeux_Faune/EPSG_3857/lizmap1/lizmap10/lizmap102/lizmap102a/lizmap_102ad/lizmap__4a3856edb956787be5830bf5b4ac779a.cache

It is serialized data files I guess.

rldhont commented 8 years ago

no it's image cache if you add .png or .jpeg at the end of the file you can open it as an image.

What are you waiting for ?

nboisteault commented 8 years ago

When I change to png, I have an invalid file. What I'd like to do is to compress more with pngcrush for example as I think QGIS doesn't compress at maximum level because it has to build image quickly.

nboisteault commented 8 years ago

I've commited https://github.com/3liz/lizmap-web-client/pull/348 to have better compression of png image in cache. To go further with optipng for example we'll need to make script which :

I didn't find a way to use optipng in php directly on the image stream. It seems possible with node.js http://php-hackers.com/p/papandreou/node-optipng