我正在成功使用angular 2 安全导航操作符作为属性,文档说明属性路径,但方法路径的最佳方法是什么?
myObj?.myMethod().myProperty
Run Code Online (Sandbox Code Playgroud)
给出例外:
EXCEPTION:TypeError:无法在[{{myObj?.myMethod().myProperty}}中读取null的属性'myProperty'
我正在运行一个用嵌入式系统编写的网络服务器.如果某人降级了固件版本,index.html的时间戳可能会倒退.如果index.html比先前版本旧,则服务器发送http 304响应(未修改),并提供该文件的缓存版本.
Web服务器代码使用http.FileServer()和http.ListenAndServe().
通过使用Posix命令修改index.html的时间戳,可以轻松地重现该问题 touch
touch -d"23:59" index.html
Run Code Online (Sandbox Code Playgroud)
然后重新加载页面
touch -d"23:58" index.html
Run Code Online (Sandbox Code Playgroud)
重新加载这个时间将在index.html上给出304响应.
有没有办法防止基于时间戳的缓存?