diff options
author | Luciano Iam <lucianito@gmail.com> | 2020-04-19 18:41:29 +0200 |
---|---|---|
committer | Robin Gareus <robin@gareus.org> | 2020-04-20 22:59:16 +0200 |
commit | 4f2fdb10a36689951d1883e9f503cde4fdb67bf4 (patch) | |
tree | 12d949db582b6f91913835dfbc8bee3272eb3a3d /libs/surfaces | |
parent | 7118eff7ebd26e1a68745634e5a4c8bb16008986 (diff) |
WebSockets: send caching headers for static resources
Diffstat (limited to 'libs/surfaces')
-rw-r--r-- | libs/surfaces/websockets/server.cc | 22 |
1 files changed, 14 insertions, 8 deletions
diff --git a/libs/surfaces/websockets/server.cc b/libs/surfaces/websockets/server.cc index 5b2306a135..2a69b5eff8 100644 --- a/libs/surfaces/websockets/server.cc +++ b/libs/surfaces/websockets/server.cc @@ -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; |