Open bradfrost opened 6 years ago
Some interesting results from here: https://stackoverflow.com/questions/1341089/using-meta-tags-to-turn-off-caching-in-all-browsers
The accepted answer (pretty old too) is verbatim to the above, but it looks to not be recommended practice.
In a production environment, I would expect developers to set cache control headers on the web server via .htaccess or an equivalent. Right?
EDIT
Answering your question more specifically, I've never seen BrowserSync have a problem reloading CSS or a pattern, but I don't know if messing with these meta tags would alter that behavior (I'd think not). Something you can certainly try while you are poking around there! 🚧
Thanks @bmuenzenmeyer!
Fascinating the post is from '09. I wonder how much of it is still relevant, especially considering cross-browser stuff is woven in there. Being that our audience is developers developing locally, it's a safe assumption they're not using IE9 as their primary dev browser.
In a production environment, I would expect developers to set cache control headers on the web server via .htaccess or an equivalent. Right?
Yep, and again I think these tags are more for dev environments where we want to see the latest changes. I think if Browsersync can wrangle that, then we use that instead.
Answering your question more specifically, I've never seen BrowserSync have a problem reloading CSS or a pattern,
That's my experience too!
, but I don't know if messing with these meta tags would alter that behavior (I'd think not). Something you can certainly try while you are poking around there! 🚧
Here's what I'm going to do: I'm going to rip out all the cache-specific meta tags, and if I start seeing issues where things aren't refreshing properly, I'll add them back in one by one, starting with <meta http-equiv="cache-control" content="no-cache" />
.
The head
looks cleaner now :)
<head>
<title id="title">Pattern Lab</title>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width" />
<link rel="stylesheet" href="styleguide/css/pattern-lab.css" media="all" />
</head>
I think the cacheBuster is all you need!
This is probably a question for @EvanLovely, but I'm trying to clean up the UI as much as possible. We currently have this code in the
head
:I believe that was to force the browser to never cache patterns so you always so the latest version. That said, I was wondering if there's another way to accomplish that without these tags? Or if it's necessary at all?