Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cache - white list of parameters for md5 key #200

Closed
wants to merge 26 commits into from
Closed

Conversation

xcaeag
Copy link

@xcaeag xcaeag commented Sep 17, 2015

Use a white list of parameters for the constitution of a unique MD5 key
Between WWW and CLI cache generation, sometimes, the list differ ("exception" param)
Seen with René-Luc : The list still needed to be adapted.

xcaeag and others added 22 commits September 17, 2015 08:30
Use a white list of parameters for the constitution of a unique  MD5 key
(between WWW and CLI cache generation)
Location search helper
This reverts commit 4cb0f8a.
optimisation de requêtes wms pour accélérer les réponses.
The mask layer name must be 'mask'.
in 4326
function search() {
$localConfig = jApp::configPath('localconfig.ini.php');
$ini = new jIniFileModifier($localConfig);

Copy link
Collaborator

@laurentj laurentj Jan 4, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

First, you shouldn't use jIniFileModifier to only read an ini file : it is very slow compare to parse_ini_file().

Second, all parameters into localconfig.ini.php are merged at run time with other configuration files, so in fact, you can access to your parameters with jApp::config()->localiz_plugin which is an array (ex: jApp::config()->localiz_plugin['db_host'])

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@laurentj we have to check all the lizmap code for this point.

// conf DB
$localConfFile = jApp::configPath('localconfig.ini.php');
if (file_exists($localConfFile)) {
$ini = new jIniFileModifier($localConfFile);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You already have a such instantiated object in $this->entrypoint->localConfigIni.

$ini->setValue('db_port', '5432', 'localiz_plugin');
$ini->setValue('db_database', 'refgeo2', 'localiz_plugin');
$ini->setValue('db_user', 'visu', 'localiz_plugin');
$ini->setValue('db_password', 'visu', 'localiz_plugin');
Copy link
Collaborator

@laurentj laurentj Jan 4, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's better to put these parameters into the profiles.ini.php (and so you don't have to create a "virtual" profil into search(), and it is more performant). And you should verify that there isn't already these parameters, to not overwrite values changed by the user.

To create a such profil, use instead the method declareDbProfile:

$this->declareDbProfile('localiz_plugin', array('driver'=>'pgsql', 'host'=>'...',...), false);

$ini->setValue('db_database', 'refgeo2', 'localiz_plugin');
$ini->setValue('db_user', 'visu', 'localiz_plugin');
$ini->setValue('db_password', 'visu', 'localiz_plugin');
$ini->setValue('db_query', "select oid, geometrytype, value, label, longlabel, xmin, ymin, xmax, ymax from MYTABLE where label like '%s%%'", 'localiz_plugin');
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's ok for this parameter to put it into the localconfig.ini.php

$this->entrypoint->localConfigIni->setValue(...);

{
// creation du mini dock
// id, titre, contenu html, index, [chemin vers css], [chemin vers js]
$bp = jApp::config()->urlengine["basePath"];
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can also use the shortcut $bp = jApp::urlBasePath() ;-)

@laurentj
Copy link
Collaborator

laurentj commented Jan 4, 2017

I did some comments about the use of jelix API. @rldhont or @mdouchin will review the lizmap part :-)

opacityLayers.reverse();
//printLayers.reverse();
//styleLayers.reverse();
//opacityLayers.reverse();
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @xcaeag you can't comment this lines, because this correction is available for QGIS 2.18 and not for 2.14.
The fix has to be more complex.

@rldhont
Copy link
Collaborator

rldhont commented Mar 30, 2017

Hi @xcaeag,
I think some part of code has not to be part of this PR. For example the module localiz has to be published in a different PR.

@xcaeag
Copy link
Author

xcaeag commented Mar 30, 2017

René-Luc, you can close this PR, the latest additions (localiz plugin ...) are quite specific to the water agency ...
Ignorance of git.
But take a look at the key md5 of the tiles of the cache...
thank you !

@rldhont
Copy link
Collaborator

rldhont commented Mar 21, 2019

With WMTS support in QGIS Server 3.* we will probably changed the way to cached tiles

@rldhont rldhont closed this Mar 21, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants