Caching #480
No reviewers
레이블
레이블 없음
A: API
A: Backend
A: Federation
A: Front-End
A: I18N
A: Meta
A: Security
Build
C: Bug
C: Discussion
C: Enhancement
C: Feature
Compatibility
Dependency
Design
Documentation
Good first issue
Help welcome
Mobile
Rendering
S: Blocked
S: Duplicate
S: Incomplete
S: Instance specific
S: Invalid
S: Needs Voting/Discussion
S: Ready for review
Suggestion
S: Voted on Loomio
S: Wontfix
마일스톤 없음
프로젝트 없음
담당자 없음
참가자 2명
알림
마감일
마감일이 설정되지 않았습니다.
전제조건
전제조건이 설정되지 않았습니다.
Reference: Plume/Plume#480
불러오는 중…
테이블 추가
Reference in a new issue
No description provided.
Delete branch "cache"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Try to cache static resources.
Static non media file's timestamps are hashed at compile tome so that modifying them invalidate old cache.
For some reason, plume-front.wasm isn't loaded from cache, even if it contains the right headers.I changed nothing and now it is? I guess I'm ok with it
I'll look into adding Etag support tooAll response made from templates and not containing a form are now Etag-cached
👀
@ -5,0 +13,4 @@
.spawn()
.expect("failed find command");
let sort = Command::new("sort")
i'd rather this wasn't random, but deterministic
such as the file's she256sum
@ -5,0 +13,4 @@
.spawn()
.expect("failed find command");
let sort = Command::new("sort")
What is your issue with it being random? It's fixed at compile time, so assuming a production server, which may restart but won't recompile often, the cache will be ok. My first through was using git commit sha, but this may be unnecessary information disclosure
@ -5,0 +13,4 @@
.spawn()
.expect("failed find command");
let sort = Command::new("sort")
if nothing about the code changes, the cache_id shouldn't change either
Codecov Report
@ -5,0 +13,4 @@
.spawn()
.expect("failed find command");
let sort = Command::new("sort")
The build won't be run again if the code didn't changed, so the ID will not change.
You should probably remove it from
Cargo.toml
too.I totally forgot about that
@ -5,0 +13,4 @@
.spawn()
.expect("failed find command");
let sort = Command::new("sort")
yes, in our development environment that is true, but not for anyone building packages or container images of our software. they always start from a clean slate
👍
@ -5,0 +13,4 @@
.spawn()
.expect("failed find command");
let sort = Command::new("sort")
btw, is there no way to do this in rust?
@ -5,0 +13,4 @@
.spawn()
.expect("failed find command");
let sort = Command::new("sort")
I think there are plenty, but I'm lazy and it's a build script. I prototyped using bash, so my rust code is basically bash translated (if you find it really bad, I can change that but I don't know if it's really useful)
@ -5,0 +13,4 @@
.spawn()
.expect("failed find command");
let sort = Command::new("sort")
nah, i was just curious
@ -11,0 +37,4 @@
.merge(HtmlCt(self.0).respond_to(r)?)
.header(ETag(EntityTag::strong(etag)))
.ok()
}
Probably obvious, but why do we disable caching on pages with a form?
@ -11,0 +37,4 @@
.merge(HtmlCt(self.0).respond_to(r)?)
.header(ETag(EntityTag::strong(etag)))
.ok()
}
If the page contain a form, the csrf token will be cached, and may no longer match user's cookies. As these tokens are added later by a fairing, there is no way to detect the page changed here. The other solution could be to allow caching of page and for rocket_csrf to remove ETag when appropriate
👍 Thanks!