notebook icon indicating copy to clipboard operation
notebook copied to clipboard

How to set up CDN acceleration for static files across multiple extensions?

Open ying2025 opened this issue 1 month ago • 2 comments

I am using extensions such as @jupyterlab/git, jupyterlab_tensorboard_pro, and @jupyter-lsp/jupyterlab-lsp. Currently, there are many small JavaScript files, and I would like to deploy these small files on a content delivery network (CDN). How should I configure it? I tried to place them in the jupyter/labextensions/ directory, and then set c.ExtensionApp.static_url_prefix = "xxx/jupyter/labextensions/" in the configuration, but it did not take effect. @minrk @jdfreder @takluyver

Proposed Solution

Additional context

ying2025 avatar Nov 25 '25 13:11 ying2025

Hi @ying2025 thank you for opening this issue, @krassowski has found that this was previously discussed in https://github.com/jupyterlab/jupyterlab/issues/5449 and the trait still exists in https://github.com/jupyterlab/jupyterlab/blob/7a5657937ddfb26a5c9287a0c24d947563809382/jupyterlab/labapp.py#L514-L521, but has not been documented. If you could take a look and see if this information helps you?

RRosio avatar Nov 25 '25 18:11 RRosio

thank you for opening this issue, @krassowski has found that this was previously discussed in jupyterlab/jupyterlab#5449 and the trait still exists in https://github.com/jupyterlab/jupyterlab/blob/7a5657937ddfb26a5c9287a0c24d947563809382/jupyterlab/labapp.py#L514-L521, but has not been documented. If you could take a look and see if this information helps you?

c.LabApp.override_static_url only overrides the static resources of the Lab, but it seems to have no effect on the static resources of extensions. There is a c.LabServerApp.labextensions_url, which seems to work for extensions by setting it. When accessing the path through frontend JavaScript, it appears to be accessing the CDN

ying2025 avatar Nov 26 '25 02:11 ying2025