by default, static resource request、xhr request will requesting onlyoffice docservice。i want docserivce only handle xhr request, so one server can afford more user request. now i optimize static resource request,through upload static resource files to oss server and edit nginx config, like following codes:
location ~ ^(\/[\d]+\.[\d]+\.[\d]+[\.|-][\d]+)?\/(web-apps|sdkjs|sdkjs-plugins|fonts)(\/.*)$ {
expires 365d;
set $folder_path $2;
set $file_path $3;
add_header Accept-Encoding "gzip";
return 301 $redirect_host$folder_path$file_path;
#alias /var/www/onlyoffice/documentserver/$folder_path$file_path;
}
However, my solution has one slightly imperfect aspect: each static resource loading requires two server requests. The first request goes to the docservice server, which then returns a 301 status redirect to the OSS server. Secondly, the browser requests the OSS server and receives a 304 status, after which the browser loads the static resource from the cached file in the browser. Throughout this process, the first step is entirely redundant. I hope the SDK can provide a way to directly set the server address for requesting static resources, thus enabling faster loading speeds for frontend pages.