13
0

WebSockets: send caching headers for static resources

This commit is contained in:
Luciano Iam 2020-04-19 18:41:29 +02:00 committed by Robin Gareus
parent 7118eff7eb
commit 4f2fdb10a3
Signed by: rgareus
GPG Key ID: A090BCE02CF57F04

View File

@ -67,17 +67,23 @@ WebsocketsServer::WebsocketsServer (ArdourSurface::ArdourWebsockets& surface)
* list of surfaces is available as a dynamically generated json file
*/
memset (&_lws_mnt_root, 0, sizeof (lws_http_mount));
_lws_mnt_root.mountpoint = "/";
_lws_mnt_root.mountpoint_len = strlen (_lws_mnt_root.mountpoint);
_lws_mnt_root.origin_protocol = LWSMPRO_FILE;
_lws_mnt_root.origin = _resources.index_dir ().c_str ();
_lws_mnt_root.mountpoint = "/";
_lws_mnt_root.mountpoint_len = strlen (_lws_mnt_root.mountpoint);
_lws_mnt_root.origin_protocol = LWSMPRO_FILE;
_lws_mnt_root.origin = _resources.index_dir ().c_str ();
_lws_mnt_root.cache_max_age = 3600;
_lws_mnt_root.cache_reusable = 1;
_lws_mnt_root.cache_revalidate = 1;
/* user defined surfaces in the user config directory */
memset (&_lws_mnt_user, 0, sizeof (lws_http_mount));
_lws_mnt_user.mountpoint = "/user";
_lws_mnt_user.mountpoint_len = strlen (_lws_mnt_user.mountpoint);
_lws_mnt_user.origin_protocol = LWSMPRO_FILE;
_lws_mnt_user.origin = _resources.user_dir ().c_str ();
_lws_mnt_user.mountpoint = "/user";
_lws_mnt_user.mountpoint_len = strlen (_lws_mnt_user.mountpoint);
_lws_mnt_user.origin_protocol = LWSMPRO_FILE;
_lws_mnt_user.origin = _resources.user_dir ().c_str ();
_lws_mnt_user.cache_max_age = 3600;
_lws_mnt_user.cache_reusable = 1;
_lws_mnt_user.cache_revalidate = 1;
_lws_mnt_root.mount_next = &_lws_mnt_user;