How to understand if you need to use expires headers

Learn more about if expires headers can speed up your website by reducing load time.

Get started growing your business with a B12 website.

No credit card required
How to understand if you need to use expires headers

Resources

Key quotes:

  • "Some AWS users, including me, use S3 to host static website and CloudFront for two reasons: Well, a good idea is setting a max-age equals to 10 years (more or less, this is not really very important) and when you update your website, you need to invalidate only the new files and objects."
  • "Using AWS CLI, list the id of a given user: Create a new key: Now you should re-type the first command, you will notice that you have two keys: Disable the old one: Delete it: Another option to reduce costs that is not widely used but could be useful in some cases, is restricting the usage of your CloudFront files to certain countries."
Read more →

Key quotes:

  • "Setting up a CDN for your assets (CSS, JS, photos, SVGs, etc.) isn’t a silver bullet on its own, but it can dramatically speed up the load time of your site and if caching is used it can decrease the used bandwidth from the origin."
  • "By default CloudFront caches objects for 24 hours on the edge nodes, but this behaviour can be modified in two ways: You can read more about how to set this up in the AWS documentation."
  • "You can add meta tags to your objects for example cache-control max-age headers and S3 will respond with those headers to the CDN."
  • "Do this on origin response this way we can cache the objects on the edge nodes when origin responds and we don’t need to execute our functions as many times as we would if we trigger the function on viewer response."
  • "We have our function deployed, but it’s not being triggered, we still don’t see the cache-control headers."
Read more →

Key quotes:

  • "All browsers attempt to keep local copies of static assets in an effort to reduce page load times and minimize network traffic."
  • "The browser won’t have any files cached for the site so it will fetch everything from the server."
  • "The browser will retrieve the HTML page from the web server but consult its cache for the static assets (JavaScript, CSS, images)."
  • "The browser inspects the headers of the HTTP response generated by the web server."
  • "The server can include an ETag in its response, which the browser can then use this in a future request (after the file has expired) to determine if the cache contains a stale copy."
  • "This tells the browser to cache the file but not to use it until it checks with the server to validate we have the latest version."
Read more →

Key quotes:

  • "The Cache-Control general-header field is used to specify directives for caching mechanisms in both requests and responses."
  • "no-store means do not store particular resource from the server anywhere (i.e browser or proxy caching )."
  • "max-age Specifies the maximum amount of time a resource will be considered fresh."
  • "The content at this URL never changes then the browser/caching servers can cache this resource for a 365 days without a problem."
  • "Cached content younger than max-age seconds can be used without consulting the server."
  • "In this pattern, browser doesn’t believe the local resource state and always validates with server to check its freshness."
Read more →

Key quotes:

  • "What’s interesting, though, is that a few HTTP clients will still consider responses cacheable if they don’t see a no-cache in the Pragma, and so the best practice to avoid caching has been to send both Cache-Control and Pragma: At the same time, a peculiar use of Pragma is by telling HTTP/1.0 caches not to cache (via Pragma) while allowing HTTP/1.1 caches to do so (via Cache-Control): Enough with expiration: it’s now time to move on to validation, a more expensive but granular way to implement HTTP caching."
Read more →

What customers & experts say

Karen
Karen Customer / The Lin Life

“B12 uses artificial intelligence to create websites quickly. The human team is friendly and accessible for those new to website development. I have a polished website in a shorter amount of time at an excellent value.”

Sheila
Sheila Customer / Dr. Sheila Hughes Weight Loss & Wellness

“There's absolutely no comparison between our old website and the B12 one. Our B12 website gives us the call to actions we need and better communication tools with our patients. Since our B12 launch, we started seeing more online visitors scheduling a consultation through our website.”

Read more →
Debra
Debra Customer / A New View of Food

“B12 has positively impacted my business with its wide variety of integrations, such as the bookings integration! I’ve been getting more emails from potential customers who are able to book online and schedule consultations with me easily. I’m not tech savvy, so if you’re like me, having a company like B12 to work with is incredibly helpful.”

Read more →
Liam
Liam Sales at B12

“B12 aims to help small business owners by saving them time to focus doing what they do best — running their business. We want to help them increase their bottom line by providing high-quality websites at a fraction of the price charged by boutique agencies and other DIFY providers.”

Annabel
Annabel Customer / Evolv Ventures

“My B12 experience has been great! What I appreciate most is that I can edit the site personally whenever I want to, but I can also ask for support when there are changes that I'm not able to make myself. B12 is great blend of a DIY service and a full-service website agency.”

Read more →
Megan
Megan Customer success at B12

“The website editor rocks! It makes it easy to add new items while keeping the same theme and structure I set when I created the site, no reformatting needed. It's fool proof and provides everything needed to create a seamless, gorgeous website. I actually use B12 for my own website!”

Nikolai
Nikolai Expert at B12

“I use B12’s website editor on a daily basis and I love how easy it is to personalize the style. I’m able to add multiple images, videos, and text in different layouts based on the preference of our customers in just a few hours! It’s been a huge time-saver, given how intuitive the interface is.”

Jaiden
Jaiden Design expert at B12

“B12’s AI draft dramatically reduces my time traditionally spent working on content structure. As a B12 web expert, I can focus more time on creating a beautiful website and UX that fits the customer’s content and goals.”

David
David Design expert at B12

“Designing a website in just a couple of hours is actually possible. Thanks to B12's simple-to-use website editor, I'm able to create professional designs that would normally cost thousands of dollars.”

Freddie
Freddie Customer / Suffolk Equity Partners

“B12 is amazing! You get a high-quality design for the price of DIY. It's really remarkable.”

Roberto
Roberto Customer / Emerald Gardens

“B12 was able to give us the flexibility we needed to play around with website elements while guiding us in our first attempt at building a website.”

Read more →
Shane
Shane Customer / Spike On The Water

“The B12 website editor is so simple to use. I added a bunch of images, reworked text, linked my products, adjusted form links, and even got an animation flying around my footer. The experience with B12 has been amazing. Building a quality website is now fast and affordable.”

Megan
Megan Customer / Body Wise

“I love using the B12 website editor, which provides the ease of updating my website myself. With an intuitive editing platform, I didn’t need any guidance on making website updates. I made changes to my photos, copy, and text color — and I can do it whenever I want.”

Natalie
Natalie Customer / Natalie Elisha Gold

“The entire \[B12] process felt really quick and efficient. I was able to work with them and highlight certain areas that I wanted on my website. Everything that I didn’t like was changed in a matter of seconds and minutes. It was vastly different compared to the previous team that I had hired to do my website.”

Read more →
Anne
Anne Customer / Grit and Grace

“The value of the B12 website was there from the very start. I noticed more traffic coming in immediately, which is hugely important for me. Knowing that B12’s tools are constantly optimizing my website for search engines offers me peace of mind. It helps me focus on running my business instead of trying to figure out how to run a website.”

Read more →

Ready to grow your business online?

Join the tens of thousands of professionals who’ve found success with a B12 website, SEO, blogging, and more!

Get a website in minutes
This website uses cookies to ensure you get the best browsing experience.  Learn more
I agree