Caching #480

Birleştirildi
Plume_migration_agent 5 yıl önce cache içindeki 3 işlemeyi master ile birleştirdi
Sahibi

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 too
All response made from templates and not containing a form are now Etag-cached

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 too~~ All response made from templates and not containing a form are now Etag-cached
igalic (github.com konumundan göç edildi) 5 yıl önce incelendi
igalic (github.com konumundan göç edildi) bir yorum yaptı

👀

👀
@ -5,0 +13,4 @@
.spawn()
.expect("failed find command");
let sort = Command::new("sort")
igalic (github.com konumundan göç edildi) 5 yıl önce yorum yaptı

i'd rather this wasn't random, but deterministic

such as the file's she256sum

i'd rather this wasn't random, but deterministic such as the file's she256sum
trinity-1686a 5 yıl önce incelendi
@ -5,0 +13,4 @@
.spawn()
.expect("failed find command");
let sort = Command::new("sort")
Poster
Sahibi

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

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
igalic (github.com konumundan göç edildi) 5 yıl önce incelendi
@ -5,0 +13,4 @@
.spawn()
.expect("failed find command");
let sort = Command::new("sort")
igalic (github.com konumundan göç edildi) 5 yıl önce yorum yaptı

if nothing about the code changes, the cache_id shouldn't change either

if nothing about the code changes, the cache_id shouldn't change either
codecov[bot] 5 yıl önce yorum yaptı (github.com konumundan göç edildi)

Codecov Report

Merging #480 into master will decrease coverage by 0.31%.
The diff coverage is 0%.

@@            Coverage Diff             @@
##           master     #480      +/-   ##
==========================================
- Coverage   27.13%   26.82%   -0.32%     
==========================================
  Files          64       64              
  Lines        7337     7423      +86     
==========================================
  Hits         1991     1991              
- Misses       5346     5432      +86
# [Codecov](https://codecov.io/gh/Plume-org/Plume/pull/480?src=pr&el=h1) Report > Merging [#480](https://codecov.io/gh/Plume-org/Plume/pull/480?src=pr&el=desc) into [master](https://codecov.io/gh/Plume-org/Plume/commit/90baf9beb1884a886d4f2bf9df96f761c582d765?src=pr&el=desc) will **decrease** coverage by `0.31%`. > The diff coverage is `0%`. ```diff @@ Coverage Diff @@ ## master #480 +/- ## ========================================== - Coverage 27.13% 26.82% -0.32% ========================================== Files 64 64 Lines 7337 7423 +86 ========================================== Hits 1991 1991 - Misses 5346 5432 +86 ```
elegaanz (github.com konumundan göç edildi) 5 yıl önce incelendi
@ -5,0 +13,4 @@
.spawn()
.expect("failed find command");
let sort = Command::new("sort")
elegaanz (github.com konumundan göç edildi) 5 yıl önce yorum yaptı

The build won't be run again if the code didn't changed, so the ID will not change.

The build won't be run again if the code didn't changed, so the ID will not change.
elegaanz (github.com konumundan göç edildi) 5 yıl önce incelendi
elegaanz (github.com konumundan göç edildi) 5 yıl önce yorum yaptı

You should probably remove it from Cargo.toml too.

You should probably remove it from `Cargo.toml` too.
trinity-1686a 5 yıl önce incelendi
Poster
Sahibi

I totally forgot about that

I totally forgot about that
igalic (github.com konumundan göç edildi) 5 yıl önce incelendi
@ -5,0 +13,4 @@
.spawn()
.expect("failed find command");
let sort = Command::new("sort")
igalic (github.com konumundan göç edildi) 5 yıl önce yorum yaptı

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

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
igalic (github.com konumundan göç edildi) 5 yıl önce incelendi
igalic (github.com konumundan göç edildi) bir yorum yaptı

👍

👍
@ -5,0 +13,4 @@
.spawn()
.expect("failed find command");
let sort = Command::new("sort")
igalic (github.com konumundan göç edildi) 5 yıl önce yorum yaptı

btw, is there no way to do this in rust?

btw, is there no way to do this in rust?
trinity-1686a 5 yıl önce incelendi
@ -5,0 +13,4 @@
.spawn()
.expect("failed find command");
let sort = Command::new("sort")
Poster
Sahibi

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)

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)
igalic (github.com konumundan göç edildi) 5 yıl önce incelendi
@ -5,0 +13,4 @@
.spawn()
.expect("failed find command");
let sort = Command::new("sort")
igalic (github.com konumundan göç edildi) 5 yıl önce yorum yaptı

nah, i was just curious

nah, i was just curious
elegaanz (github.com konumundan göç edildi) 5 yıl önce incelendi
@ -11,0 +37,4 @@
.merge(HtmlCt(self.0).respond_to(r)?)
.header(ETag(EntityTag::strong(etag)))
.ok()
}
elegaanz (github.com konumundan göç edildi) 5 yıl önce yorum yaptı

Probably obvious, but why do we disable caching on pages with a form?

Probably obvious, but why do we disable caching on pages with a form?
trinity-1686a 5 yıl önce incelendi
@ -11,0 +37,4 @@
.merge(HtmlCt(self.0).respond_to(r)?)
.header(ETag(EntityTag::strong(etag)))
.ok()
}
Poster
Sahibi

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

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
elegaanz (github.com konumundan göç edildi) 5 yıl önce bu değişiklikleri onayladı
elegaanz (github.com konumundan göç edildi) bir yorum yaptı

👍 Thanks!

:+1: Thanks!

Gözden Geçirenler

Değişiklik isteği a2b2e37aa0 olarak birleştirildi.
komut satırı talimatlarını da görüntüleyebilirsiniz.

1. Adım:

Proje deponuzdan yeni bir dala göz atın ve değişiklikleri test edin.
git checkout -b cache master
git pull origin cache

2. Adım:

Forgejo'daki değişiklikleri ve güncellemeleri birleştirin.
git checkout master
git merge --no-ff cache
git push origin master
Bu konuşmaya katılmak için oturum aç.
Değerlendirici yok
Kilometre Taşı Yok
Atanan Kişi Yok
2 Katılımcı
Bildirimler
Bitiş Tarihi
Bitiş tarihi geçersiz veya aralık dışında. Lütfen 'yyyy-aa-gg' biçimini kullanın.

Bitiş tarihi atanmadı.

Bağımlılıklar

Bağımlılık yok.

Referans: Plume/Plume#480
Yükleniyor…
Henüz bir içerik yok.