Advanced Search WIP: new mechanism for passing the dictionary to the client side. Hopefully faster than before thanks to the browser's cache.

SVN:b1162[5453]
This commit is contained in:
Denis Flaven
2018-03-16 17:44:55 +00:00
parent 52f56e1bb0
commit f8f6e201b9
5 changed files with 135 additions and 32 deletions

View File

@@ -2528,6 +2528,15 @@ EOF
$oPage->add(json_encode($aResult));
break;
case 'dict':
$sSignature = Utils::ReadParam('s', ''); // Sanitization prevents / and ..
$oPage = new ajax_page(""); // New page to cleanup the no_cache done above
$oPage->SetContentType('text/javascript');
$oPage->add_header('Cache-control: public, max-age=86400'); // Cache for 24 hours
$oPage->add_header("Pragma: cache"); // Reset the value set .... where ?
$oPage->add(file_get_contents(Utils::GetCachePath().$sSignature.'.js'));
break;
default:
$oPage->p("Invalid query.");
}