aboutsummaryrefslogtreecommitdiffhomepage
path: root/pingora-cache
diff options
context:
space:
mode:
authorYuchen Wu <[email protected]>2024-03-01 11:51:14 -0800
committerYuchen Wu <[email protected]>2024-03-01 13:47:27 -0800
commit8160ad169878ea6b4884b977f2a96541083036c4 (patch)
tree3e0100f38369e96a7e27456230e1e841b021cd3f /pingora-cache
parente8113822247b5f9bb4eab34cb10121b873e73fd1 (diff)
downloadpingora-8160ad169878ea6b4884b977f2a96541083036c4.tar.gz
pingora-8160ad169878ea6b4884b977f2a96541083036c4.zip
Fix typos and grammar issues
Co-authored-by: =?~~~?q?Ren=C3=A9=20Kla=C4=8Dan?= <[email protected]> Co-authored-by: 12932 <[email protected]> Co-authored-by: Alessandro <[email protected]> Co-authored-by: InImpasse <[email protected]> Co-authored-by: Paul James Cleary <[email protected]> Co-authored-by: Yang Hau <[email protected]> Co-authored-by: Morpheus <[email protected]> Co-authored-by: mobeicanyue <[email protected]> Co-authored-by: Twacqwq <[email protected]> Co-authored-by: Bobby <[email protected]> Co-authored-by: Dup4 <[email protected]> Co-authored-by: Josh Soref <[email protected]> Co-authored-by: Sheldon <[email protected]> Co-authored-by: houseme <[email protected]> Co-authored-by: ZhangIvan1 <[email protected]> Co-authored-by: GrahamQuan <[email protected]> Co-authored-by: =?~~~?q?Cristian=20Paul=20Pe=C3=B1aranda=20Rojas?= <[email protected]> Co-authored-by: Nathan Sit <[email protected]> Co-authored-by: David Lee <[email protected]> Co-authored-by: Mengliang Su <[email protected]> Co-authored-by: =?~~~?q?=EA=B9=80=EC=84=A0=EC=9A=B0?= <[email protected]> Co-authored-by: Allen Huang <[email protected]> Co-authored-by: Opacity <[email protected]> Co-authored-by: cris <[email protected]> Co-authored-by: Killian Ye <[email protected]> Co-authored-by: Jiwei-dev <[email protected]> Co-authored-by: Jinfeng Wang <[email protected]> Co-authored-by: Ikko Eltociear Ashimine <[email protected]>
Diffstat (limited to 'pingora-cache')
-rw-r--r--pingora-cache/src/eviction/lru.rs2
-rw-r--r--pingora-cache/src/eviction/mod.rs6
-rw-r--r--pingora-cache/src/filters.rs2
-rw-r--r--pingora-cache/src/lib.rs2
-rw-r--r--pingora-cache/src/memory.rs2
-rw-r--r--pingora-cache/src/meta.rs4
6 files changed, 9 insertions, 9 deletions
diff --git a/pingora-cache/src/eviction/lru.rs b/pingora-cache/src/eviction/lru.rs
index 47c88a6..35ceb77 100644
--- a/pingora-cache/src/eviction/lru.rs
+++ b/pingora-cache/src/eviction/lru.rs
@@ -32,7 +32,7 @@ use std::time::SystemTime;
///
/// - Space optimized in-memory LRU (see [pingora_lru]).
/// - Instead of a single giant LRU, this struct shards the assets into `N` independent LRUs.
-/// This allows [EvictionManager::save()] not to lock the entire cache mananger while performing
+/// This allows [EvictionManager::save()] not to lock the entire cache manager while performing
/// serialization.
pub struct Manager<const N: usize>(Lru<CompactCacheKey, N>);
diff --git a/pingora-cache/src/eviction/mod.rs b/pingora-cache/src/eviction/mod.rs
index 7c9d60b..bb32c62 100644
--- a/pingora-cache/src/eviction/mod.rs
+++ b/pingora-cache/src/eviction/mod.rs
@@ -29,9 +29,9 @@ pub mod simple_lru;
/// be handled the implementations internally.
#[async_trait]
pub trait EvictionManager {
- /// Total size of the cache in bytes tracked by this eviction mananger
+ /// Total size of the cache in bytes tracked by this eviction manager
fn total_size(&self) -> usize;
- /// Number of assets tracked by this eviction mananger
+ /// Number of assets tracked by this eviction manager
fn total_items(&self) -> usize;
/// Number of bytes that are already evicted
///
@@ -76,7 +76,7 @@ pub trait EvictionManager {
/// method shouldn't change the popularity of the asset being peeked.
fn peek(&self, item: &CompactCacheKey) -> bool;
- /// Serialize to save the state of this eviction mananger to disk
+ /// Serialize to save the state of this eviction manager to disk
///
/// This function is for preserving the eviction manager's state across server restarts.
///
diff --git a/pingora-cache/src/filters.rs b/pingora-cache/src/filters.rs
index 8293cb5..4255673 100644
--- a/pingora-cache/src/filters.rs
+++ b/pingora-cache/src/filters.rs
@@ -187,7 +187,7 @@ pub mod upstream {
// remove downstream range header as we'd like to cache the entire response (this might change in the future)
req.remove_header(&header::RANGE);
- // we have a persumably staled response already, add precondition headers for revalidation
+ // we have a presumably staled response already, add precondition headers for revalidation
if let Some(m) = meta {
// rfc7232: "SHOULD send both validators in cache validation" but
// there have been weird cases that an origin has matching etag but not Last-Modified
diff --git a/pingora-cache/src/lib.rs b/pingora-cache/src/lib.rs
index be352dc..2bf0b92 100644
--- a/pingora-cache/src/lib.rs
+++ b/pingora-cache/src/lib.rs
@@ -340,7 +340,7 @@ impl HttpCache {
/// Enable the cache
///
/// - `storage`: the cache storage backend that implements [storage::Storage]
- /// - `eviction`: optionally the eviction mananger, without it, nothing will be evicted from the storage
+ /// - `eviction`: optionally the eviction manager, without it, nothing will be evicted from the storage
/// - `predictor`: optionally a cache predictor. The cache predictor predicts whether something is likely
/// to be cacheable or not. This is useful because the proxy can apply different types of optimization to
/// cacheable and uncacheable requests.
diff --git a/pingora-cache/src/memory.rs b/pingora-cache/src/memory.rs
index 679517d..525bf23 100644
--- a/pingora-cache/src/memory.rs
+++ b/pingora-cache/src/memory.rs
@@ -151,7 +151,7 @@ impl PartialHit {
};
assert!(bytes_end >= self.bytes_read);
- // more data avaliable to read
+ // more data available to read
if bytes_end > self.bytes_read {
let new_bytes =
Bytes::copy_from_slice(&self.body.read()[self.bytes_read..bytes_end]);
diff --git a/pingora-cache/src/meta.rs b/pingora-cache/src/meta.rs
index a534dc0..9873ef8 100644
--- a/pingora-cache/src/meta.rs
+++ b/pingora-cache/src/meta.rs
@@ -316,7 +316,7 @@ pub(crate) struct CacheMetaInner {
pub(crate) internal: InternalMeta,
pub(crate) header: ResponseHeader,
/// An opaque type map to hold extra information for communication between cache backends
- /// and users. This field is **not** garanteed be persistently stored in the cache backend.
+ /// and users. This field is **not** guaranteed be persistently stored in the cache backend.
pub extensions: Extensions,
}
@@ -567,7 +567,7 @@ use pingora_header_serde::HeaderSerde;
use std::fs::File;
use std::io::Read;
-/* load header compression engine and its' dictionary globally */
+/* load header compression engine and its dictionary globally */
pub(crate) static COMPRESSION_DICT_PATH: OnceCell<String> = OnceCell::new();
fn load_file(path: &String) -> Option<Vec<u8>> {