mirror of https://github.com/kiwix/libkiwix.git
Merge pull request #856 from kiwix/compress-web-fonts
Gzip compress HTTP response for Web fonts
This commit is contained in:
commit
6790a144a1
|
@ -64,7 +64,13 @@ bool is_compressible_mime_type(const std::string& mimeType)
|
|||
|| mimeType.find("application/javascript") != std::string::npos
|
||||
|| mimeType.find("application/atom") != std::string::npos
|
||||
|| mimeType.find("application/opensearchdescription") != std::string::npos
|
||||
|| mimeType.find("application/json") != std::string::npos;
|
||||
|| mimeType.find("application/json") != std::string::npos
|
||||
|
||||
// Web fonts
|
||||
|| mimeType.find("application/font-") != std::string::npos
|
||||
|| mimeType.find("application/x-font-") != std::string::npos
|
||||
|| mimeType.find("application/vnd.ms-fontobject") != std::string::npos
|
||||
|| mimeType.find("font/") != std::string::npos;
|
||||
}
|
||||
|
||||
bool compress(std::string &content) {
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
resource_files = run_command(res_manager,
|
||||
'--list-all',
|
||||
files('resources_list.txt')
|
||||
files('resources_list.txt'),
|
||||
check: true
|
||||
).stdout().strip().split('\n')
|
||||
|
||||
preprocessed_resources = custom_target('preprocessed_resource_files',
|
||||
|
@ -33,7 +34,8 @@ lib_resources = custom_target('resources',
|
|||
i18n_resource_files = run_command(find_program('python3'),
|
||||
'-c',
|
||||
'import sys; f=open(sys.argv[1]); print(f.read())',
|
||||
files('i18n_resources_list.txt')
|
||||
files('i18n_resources_list.txt'),
|
||||
check: true
|
||||
).stdout().strip().split('\n')
|
||||
|
||||
i18n_resources = custom_target('i18n_resources',
|
||||
|
|
|
@ -70,6 +70,10 @@ const ResourceCollection resources200Compressible{
|
|||
{ STATIC_CONTENT, "/ROOT/skin/taskbar.css?cacheid=216d6b5d" },
|
||||
{ DYNAMIC_CONTENT, "/ROOT/skin/viewer.js" },
|
||||
{ STATIC_CONTENT, "/ROOT/skin/viewer.js?cacheid=51e745c2" },
|
||||
{ DYNAMIC_CONTENT, "/ROOT/skin/fonts/Poppins.ttf" },
|
||||
{ STATIC_CONTENT, "/ROOT/skin/fonts/Poppins.ttf?cacheid=af705837" },
|
||||
{ DYNAMIC_CONTENT, "/ROOT/skin/fonts/Roboto.ttf" },
|
||||
{ STATIC_CONTENT, "/ROOT/skin/fonts/Roboto.ttf?cacheid=84d10248" },
|
||||
|
||||
{ DYNAMIC_CONTENT, "/ROOT/catalog/search" },
|
||||
|
||||
|
@ -124,10 +128,6 @@ const ResourceCollection resources200Uncompressible{
|
|||
{ STATIC_CONTENT, "/ROOT/skin/favicon/safari-pinned-tab.svg?cacheid=8d487e95" },
|
||||
{ DYNAMIC_CONTENT, "/ROOT/skin/favicon/site.webmanifest" },
|
||||
{ STATIC_CONTENT, "/ROOT/skin/favicon/site.webmanifest?cacheid=bc396efb" },
|
||||
{ DYNAMIC_CONTENT, "/ROOT/skin/fonts/Poppins.ttf" },
|
||||
{ STATIC_CONTENT, "/ROOT/skin/fonts/Poppins.ttf?cacheid=af705837" },
|
||||
{ DYNAMIC_CONTENT, "/ROOT/skin/fonts/Roboto.ttf" },
|
||||
{ STATIC_CONTENT, "/ROOT/skin/fonts/Roboto.ttf?cacheid=84d10248" },
|
||||
{ DYNAMIC_CONTENT, "/ROOT/skin/hash.png" },
|
||||
{ STATIC_CONTENT, "/ROOT/skin/hash.png?cacheid=f836e872" },
|
||||
{ DYNAMIC_CONTENT, "/ROOT/skin/magnet.png" },
|
||||
|
|
Loading…
Reference in New Issue