Skip to content

Commit a38fc8e

Browse files
committed
More targeted preconnecting
1 parent b85dad7 commit a38fc8e

3 files changed

Lines changed: 20 additions & 5 deletions

File tree

_config.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ description: "Write an awesome description for your new site here. You can edit
55
baseurl: ""
66
url: "https://csswizardry.com"
77
future: true
8-
sw: "0012"
8+
sw: "0013"
99

1010
# Build settings
1111
markdown: kramdown

_includes/head.html

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,19 +3,32 @@
33
<meta name="viewport" content="width=device-width, minimum-scale=1.0">
44

55
{% if page.page-class == "page--home" %}
6-
<!-- Fire off masthead download nice and early. -->
6+
{% comment %}
7+
<!--
8+
- Fire off masthead download nice and early.
9+
- Only needed on homepage.
10+
-->
11+
{% endcomment %}
712
<link rel="preload" href="/img/css/masthead.jpg" as="image" media="(max-width: 719px)">
813
<link rel="preload" href="/img/css/masthead-medium.jpg" as="image" media="(min-width: 720px) and (max-width: 1023px)">
914
<link rel="preload" href="/img/css/masthead-large.jpg" as="image" media="(min-width: 1024px)">
1015
{% endif %}
1116

12-
<!-- Preemptively open up connections for external assets (Twitter widgets etc). -->
17+
{% comment %}
18+
<!--
19+
- Preemptively open up connections for external assets (Twitter widgets etc).
20+
- Only needed on pages with sidebars (i.e. non-feature pages).
21+
-->
22+
{% endcomment %}
23+
{% if page.layout != "feature" %}
1324
<link rel="preconnect" href="//cdn.carbonads.com">
1425
<link rel="preconnect" href="//srv.carbonads.net">
1526
<link rel="preconnect" href="//platform.twitter.com">
1627
<link rel="preconnect" href="https://platform.twitter.com">
1728
<link rel="preconnect" href="https://syndication.twitter.com">
1829
<link rel="preconnect" href="https://cdn.syndication.twimg.com">
30+
{% endif %}
31+
1932
<link rel="preconnect" href="//www.google-analytics.com">
2033
<link rel="preconnect" href="https://www.google-analytics.com">
2134

@@ -57,6 +70,8 @@
5770
<meta name="theme-color" content="#f43059">
5871
<link rel="manifest" href="/manifest.json">
5972

73+
{% if page.layout != "feature" %}
6074
<script src="https://platform.twitter.com/widgets.js" defer></script>
75+
{% endif %}
6176

6277
</head>

sw.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
var cacheName = 'csswizardry:0012';
1+
var cacheName = 'csswizardry:0013';
22
var cacheFiles = [
33
'/',
44
'/about/',
@@ -53,7 +53,7 @@ self.addEventListener('fetch', function(event) {
5353
// Empty out any caches that don’t match the ones listed.
5454
self.addEventListener('activate', function(event) {
5555

56-
var cacheWhitelist = ['csswizardry:0012'];
56+
var cacheWhitelist = ['csswizardry:0013'];
5757

5858
event.waitUntil(
5959
caches.keys().then(function(cacheNames) {

0 commit comments

Comments
 (0)