Hi,

My restxq app is very slow to deliver raw files (css, images, js).
For example, the restxq method takes around 600ms to load a png file in my browser when it takes only 2ms in a "direct" or "static" way.

---------------------------------------
declare
  %rest:path("/editions/static/{$project}/{$file=.+}")
function max.file:file(
  $project as xs:string,
  $file as xs:string
) as item()+ {
let $path := file:parent(file:base-dir()) || 'editions/' || $project || '/ui/' || $file
  return (
    web:response-header(map { 'media-type': web:content-type($path) }),
    file:read-binary($path)
  )
};
---------------------------------------

Why such a difference?
How can I improve it?

I am using BaseX 8.3 (war version).

Regards,

Jérôme


--
Jérôme Chauveau - CERTIC-DSI - Campus I
Université de Caen Normandie

Reply via email to