From d2455aa1c1bfc599a07966a7d717c1380d41bbc0 Mon Sep 17 00:00:00 2001 From: Christine Dodrill Date: Thu, 14 Jan 2021 22:36:34 -0500 Subject: Cache better (#296) * Many improvements around bandwidth use - Use ETags for RSS/Atom feeds - Use cache-control headers - Update to rust nightly (for rust-analyzer and faster builds) - Limit feeds to the last 20 posts: https://twitter.com/theprincessxena/status/1349891678857998339 - Use if-none-match to limit bandwidth further Also does this: - bump go_vanity to 0.3.0 and lets users customize the branch name - fix formatting on jsonfeed - remove last vestige of kubernetes/docker support Signed-off-by: Christine Dodrill * expire cache quicker for dynamic pages Signed-off-by: Christine Dodrill * add rss ttl Signed-off-by: Christine Dodrill * add blogpost Signed-off-by: Christine Dodrill --- lib/jsonfeed/src/builder.rs | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'lib/jsonfeed/src/builder.rs') diff --git a/lib/jsonfeed/src/builder.rs b/lib/jsonfeed/src/builder.rs index f17740f..640a280 100644 --- a/lib/jsonfeed/src/builder.rs +++ b/lib/jsonfeed/src/builder.rs @@ -1,7 +1,7 @@ use std::default::Default; use errors::*; -use feed::{Feed, Author, Attachment}; +use feed::{Attachment, Author, Feed}; use item::{Content, Item}; /// Feed Builder @@ -160,7 +160,7 @@ impl ItemBuilder { match self.content { Some(Content::Text(t)) => { self.content = Some(Content::Both(i.into(), t)); - }, + } _ => { self.content = Some(Content::Html(i.into())); } @@ -172,10 +172,10 @@ impl ItemBuilder { match self.content { Some(Content::Html(s)) => { self.content = Some(Content::Both(s, i.into())); - }, + } _ => { self.content = Some(Content::Text(i.into())); - }, + } } self } @@ -197,8 +197,7 @@ impl ItemBuilder { date_modified: self.date_modified, author: self.author, tags: self.tags, - attachments: self.attachments + attachments: self.attachments, }) } } - -- cgit v1.2.3