<div dir="ltr"><div class="gmail_quote"><div dir="ltr"><div>Alessandro,</div><div><br></div><div>Thanks for answering, yes I have fcgid enabled and I meant configuration stuff especially getprojectsetting request which is taking very long on certain project. So that is cached, in memory I assume?</div>

<div><br></div><div>Are there any settings, I would to keep the cache unless I saved the project or restart server, which are obvious cases to remove cache. From the code example I see that if the project is changed it is removed from cache, I don't see any other cases.</div>

<div><br></div><div>Can I use apache cache modules to save the cache to disk?</div><div><br></div><div>How are anyone dealing with this on production servers?</div><div><br></div><div>regards,</div><div>Uros</div><div><br>

</div></div><div class="gmail_extra"><br><br><div class="gmail_quote">2014-08-26 19:33 GMT+02:00 Alessandro Pasotti <span dir="ltr"><<a href="mailto:apasotti@gmail.com" target="_blank">apasotti@gmail.com</a>></span>:<div>
<div class="h5"><br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">2014-08-26 19:05 GMT+02:00 Uros Preloznik <<a href="mailto:uros00@gmail.com" target="_blank">uros00@gmail.com</a>>:<br>

<div><div>> Hi,<br>
><br>
> I would like to have more information regarding Qgis server caching certain<br>
> requests and how to control that. I didn't find any documentation regarding<br>
> this, so I ask.<br>
><br>
> Example:<br>
> On my environment (ubuntu 12.04, apache 2.2.22, qgis 2.4) I do<br>
> GetProjectSettings request on certain project. If I restart Apache or save<br>
> the project the request is not cached (I assume) and it takes from 20 - 65<br>
> seconds. In order to avoid Server Error after 40second I added this line to<br>
> Apache configuration<br>
><br>
> FcgidIOTimeout 80<br>
><br>
> So, after this long request, next same request is immediately so it must be<br>
> cached, right? I tested with different clients and must be on server. But I<br>
> do not control this, because after unknown amount of time the cache is<br>
> removed.<br>
><br>
> Can anyone explain this and should I explore basic Apache caching tehniques<br>
> like this:<br>
> <a href="http://httpd.apache.org/docs/2.2/caching.html" target="_blank">http://httpd.apache.org/docs/2.2/caching.html</a><br>
><br>
> Right now I don't have any caching modules enabled in Apache.<br>
><br>
> Another question is why is it taking so long, but I will ask that extra.<br>
><br>
> thanks<br>
><br>
> Uros<br>
><br>
<br>
</div></div>Hi Uros,<br>
<br>
I might be wrong but I think that request are not cached in the<br>
standard sense, the startup delay is due to the application startup<br>
time ant to the first time parsing of the project file that also needs<br>
to instanciate many objects.<br>
<br>
What is cached are project configurations (parsed project files) for<br>
the available services, layers, getcapabilities and getprojectsettings<br>
requests, but the caches are invalidate whenever the project file<br>
changes on disk, for instance see:<br>
<br>
<a href="https://github.com/elpaso/QGIS/blob/master/src/mapserver/qgsconfigcache.cpp#L36" target="_blank">https://github.com/elpaso/QGIS/blob/master/src/mapserver/qgsconfigcache.cpp#L36</a><br>
<br>
 The end of the story is that there at the first request there is the<br>
application startup time + the configuration parsing for the<br>
particular service and project tuple, the next requests for the same<br>
service and project is considerably faster because it doesn't have to<br>
start the application nor to parse the project file and instanciate<br>
all the stuff.<br>
<br>
Of course, all this goodies come only with FCGI, if you run the server<br>
in CGI mode, then all requests are treated as the first one.<br>
<span><font color="#888888"><br>
--<br>
Alessandro Pasotti<br>
w3:   <a href="http://www.itopen.it" target="_blank">www.itopen.it</a><br>
</font></span></blockquote></div></div></div><br></div>
</div><br></div>