Merge pull request #87 from swiftugandan/master

do not cache results for searches from the welcome page
This commit is contained in:
Matthieu Gautier 2017-11-09 15:48:15 +01:00 committed by GitHub
commit f03ed85972
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -452,6 +452,12 @@ static struct MHD_Response* handle_search(RequestContext* request_context)
request_context->connection, MHD_GET_ARGUMENT_KIND, "pattern");
std::string patternString
= kiwix::urlDecode(pattern == NULL ? "" : string(pattern));
/* Search results for searches from the welcome page should not
be cached
*/
bool cacheEnabled = !(request_context->searcher == globalSearcher);
std::string patternCorrespondingUrl;
/* Try first to load directly the article */
@ -506,7 +512,7 @@ static struct MHD_Response* handle_search(RequestContext* request_context)
httpRedirection,
mimeType,
deflated,
true);
cacheEnabled);
}
static struct MHD_Response* handle_random(RequestContext* request_context)