moonfire-nvr/Cargo.toml
Scott Lamb 45abeb22de overhaul HTTP serving and caching
* use content-hashed paths for static resources (except the top-level
  request), with immutable Cache-Control headers. This should improve
  cache behavior in both directions: avoid preventable HTTP requests and
  cause immediate refresh when needed. I had some staleness when
  browsing with my phone.

* set up the favicons properly while I'm at it (closes #50). I used the
  convenient favicons-webpack-plugin to build everything from a .svg.
  I've hit an error similar to lovell/sharp#1593 at least once though so
  I might change my mind about that part if it continues to be
  problematic.

* use http-serve's new directory traversal code for static file serving.
  This removes the odd behavior where files that weren't present at
  server startup couldn't be served. (I wasn't comfortable switching to
  the content-hashed paths before doing this.) It also means the static
  files can be served compressed. JSON API responses were already served
  compressed, so this closes #25.

* for a given API URL, decide if we want it to be cached or not
  server-side. Stop using jQuery's kludgy cache-defeating _=<timestamp>
  URL parameter. I might start setting etags on some of these things
  and could serve 304 Not Modified responses if it's genuinely
  unmodified.
2020-05-29 21:20:15 -07:00

69 lines
1.8 KiB
TOML

[package]
name = "moonfire-nvr"
version = "0.1.0"
authors = ["Scott Lamb <slamb@slamb.org>"]
edition = "2018"
[features]
# The nightly feature is used within moonfire-nvr itself to gate the
# benchmarks. Also pass it along to crates that can benefit from it.
nightly = ["db/nightly", "parking_lot/nightly", "smallvec/union"]
# The bundled feature includes bundled (aka statically linked) versions of
# native libraries where possible.
bundled = ["rusqlite/bundled"]
[workspace]
members = ["base", "db", "ffmpeg"]
[dependencies]
base = { package = "moonfire-base", path = "base" }
base64 = "0.11.0"
bytes = "0.5.3"
byteorder = "1.0"
cstr = "0.1.7"
cursive = "0.14.0"
db = { package = "moonfire-db", path = "db" }
structopt = { version = "0.3.13", features = ["default", "wrap_help"] }
failure = "0.1.1"
ffmpeg = { package = "moonfire-ffmpeg", path = "ffmpeg" }
futures = "0.3"
fnv = "1.0"
http = "0.2.0"
http-serve = { git = "https://github.com/scottlamb/http-serve", branch = "dir", features = ["dir"] }
hyper = "0.13.0"
lazy_static = "1.0"
libc = "0.2"
log = { version = "0.4", features = ["release_max_level_info"] }
memchr = "2.0.2"
memmap = "0.7"
mylog = { git = "https://github.com/scottlamb/mylog" }
nix = "0.17.0"
nom = "5.1.1"
openssl = "0.10"
parking_lot = { version = "0.10", features = [] }
protobuf = { git = "https://github.com/stepancheg/rust-protobuf" }
reffers = "0.6.0"
ring = "0.14.6"
rusqlite = "0.22.0"
serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0"
smallvec = "1.0"
time = "0.1"
tokio = { version = "0.2.0", features = ["blocking", "macros", "parking_lot", "rt-threaded", "signal"] }
tokio-tungstenite = "0.10.1"
url = "2.1.1"
uuid = { version = "0.8", features = ["serde", "std", "v4"] }
[dev-dependencies]
reqwest = { version = "0.10.1", features = ["json"] }
tempdir = "0.3"
[profile.release]
debug = true
[profile.bench]
debug = true