0:06
[Music]
0:08
foreign
0:09
[Music]
0:15
everybody this is Joshua from
0:17
stacksweaver today I want to talk to you
0:19
about my new stack cloudflare Dev tools
0:21
that I just released
0:22
a lot of you may ask what is cloudflare
0:24
devtools and how will this help me with
0:26
my websites
0:27
first let's start off with what is
0:28
cloudflare cloudflare is a Content
0:31
delivery Network that serves up cached
0:34
versions of your website to users around
0:36
the world if you have a server in the
0:38
United States and someone is browsing
0:39
from England cloudflare will actually
0:41
serve up cached content from a local
0:43
server in England allowing for faster
0:45
speeds on your website for those of us
0:48
who utilize a CMS based system to edit
0:50
our websites struggle with cloudflare is
0:53
making changes to your site while the
0:54
cache is active when you go to change an
0:56
image that's already been on your
0:58
website you won't see those changes
1:00
reflected immediately cloudflare will
1:02
still serve up the cached version of
1:04
your image this is why cloudflare has a
1:07
tool called development mode by turning
1:09
on development mode you bypass their
1:11
cache for three hours allowing you to
1:13
make changes and see them instantly on
1:15
your website
1:16
now I'll turn this back off here on this
1:18
website now you'll see here on this
1:20
visit edmunds.com website that in the
1:23
last 30 days they've had 30 000 unique
1:26
visitors
1:27
4.08 million requests and you see here
1:30
that they have 168 gigabytes cached and
1:34
a total of 239 gigabytes sir that means
1:37
that there was 239 gigabytes of requests
1:40
to my web server that was not served by
1:43
my web server but served by cloudflare
1:45
instead this means that cloudflare saved
1:47
me 239 gigabytes of bandwidth from
1:50
impacting my server performance this is
1:52
an amazing feature to have to allow my
1:56
web server to host more websites without
1:58
being overrun by requests my stack
2:01
allows you to turn on cloudflare dev
2:03
mode from your website without having to
2:06
log in to cloudflare themselves great
2:08
example of this would be the visit admin
2:10
site that I have here I don't edit the
2:12
content but somebody else does this
2:14
would allow them to turn on dev mode
2:15
without logging into my cloudflare
2:17
account this is why I made cloudfire Dev
2:20
tools let's have a look at the visit
2:22
admin site here you'll see here in the
2:24
admin they actually have a turn on dev
2:26
mode button for cloudflare Dev mode if
2:29
they're admin logs in and needs to make
2:30
edits they just click the button to turn
2:32
on devmob and you'll see here that it
2:34
turns on
2:37
and if we refresh the page over here on
2:39
cloudflare you'll see that devmode has
2:41
indeed turned on
2:43
all of this was done from the back end
2:44
of their website not requiring me to
2:47
help them out with it now what's also
2:48
cool is there is an additional button
2:51
that comes within the stack which is
2:52
Purge cache so this allows them to press
2:55
this purge cache button and the purge
2:57
cache get initiated and it will actually
2:59
clear out the cloudflare's cache of your
3:02
domain
3:03
if you're doing a lot of updates you
3:05
know you first you come in turn on dev
3:06
mode
3:07
and then from there you can make all
3:11
your changes do everything you need to
3:12
do then you can go and Purge cache and
3:15
then you're good to go
3:16
but here is an example of what comes
3:18
with the cloudflare dev tools it
3:20
actually has three child Stacks allowing
3:23
you to customize how you want the data
3:24
to show up on your website
3:26
the first stack is the dev mode status
3:29
so this will either say on or off if we
3:32
turn this on you'll see here the status
3:34
says it's on if you refresh the page it
3:36
will refresh with the current status on
3:39
or off so this could be on a multitude
3:41
of pages at the top in the admin so as
3:44
you browse from page to page it will let
3:45
you know what the status is and then you
3:48
could have the button Elsewhere on the
3:49
page or maybe in a settings page same
3:51
with the purge button the second child
3:53
stack is the dev mode button this is the
3:55
button that allows you to actually
3:56
toggle development mode on cloudflare
3:58
simple thing you just click it and it
4:01
changes
4:02
and then it comes with The Purge cache
4:04
button so all of these can be run in one
4:07
stack right on top of each other or you
4:09
can have multiple stacks on the page and
4:11
put these where you need them to be
4:12
there's some cool customizable features
4:14
built into Cloud for devtools first of
4:16
all there is classes that are added to
4:18
the status button and to the toggle
4:20
button based on the status of cloudflare
4:23
Dev mode so if it's on you can Target
4:25
the on status via CSS and you can Target
4:28
the off status of via CSS this allows
4:31
you to colorize them or change the look
4:33
of them based on their status
4:36
how about we set this stack up from
4:38
scratch on stacksweaver
4:43
search for cloudfire devtools in your
4:45
stocks library and drag it onto your
4:47
page
4:49
whereas to get the initial setup done
4:51
we're going to need an API key a Zone ID
4:53
and a worker URL so let's get started
4:57
to get an API key we're going to go back
4:59
to cloudflare
5:01
now we're going to go with the
5:02
assumption that you've already set up
5:03
your domain with cloudflare this is not
5:06
going to be instructions on how to do
5:07
that you can check out cloudflare's
5:08
website to get that instructions
5:11
to get an API key you're just going to
5:13
click your profile on the top right and
5:15
then click on my profile and API tokens
5:18
what you need to set up with your API
5:20
token is these two settings here so I'm
5:23
just going to quickly screenshot this so
5:25
we have access to this
5:30
so we need Zone settings and Zone cache
5:33
Purge
5:34
so let's create a new token
5:39
and we're going to go custom token
5:41
so we're going to call this one
5:44
Stacks waiver
5:48
so we're looking at Zone
5:51
and we want settings
5:54
Zone settings
5:59
all right
6:00
edit
6:02
and we also need
6:05
Zone
6:07
cash Purge
6:10
perch
6:13
and then just continue on to summary
6:17
this looks good so we're going to create
6:18
token now that we have the token we're
6:21
going to copy it back to our stack in
6:23
rapidweaver
6:26
now we're looking for the Zone key now
6:28
we're using stacksweaver.com so we're
6:30
going to click back here
6:32
home go to stackswaver.com
6:35
if we scroll down here we have a Zone ID
6:40
and copy that
6:44
paste that in
6:46
and then we need a worker URL
6:49
so if you go like back on the cloudflare
6:52
go up to your dashboard and if you
6:54
scroll down here to workers and pages
6:56
and go create application
6:59
and we're going to go create worker
7:04
and it's just going to say hello world
7:06
but we're just going to say you know
7:09
this
7:14
is
7:16
uh test
7:22
and go deploy
7:27
now we're going to click on configure
7:28
worker now what we need out of this is
7:31
this domain so we're just going to copy
7:33
that out
7:39
I'm going to put that right into the
7:41
worker URL just going to button here
7:44
there was a mistake with this URL you
7:46
have to ensure that you start with https
7:51
at the beginning colon slash slash that
7:54
needs to be included
7:57
as well as at the very end you need to
7:59
have the following slashes as it says
8:01
right below just make sure you have that
8:03
slash at the end and HTTP at the
8:05
beginning
8:06
so now that we've got these three set up
8:09
we can press setup complete
8:12
and then we need to show the cloudflare
8:14
worker code and hit preview
8:18
now on my site here it is actually hard
8:20
to see the code just because I have my
8:23
site in dark mode but if you see in here
8:26
there is this box that shows up with all
8:28
the code you just hit command a and
8:30
select all and copy all of that code
8:34
and we're going to copy that code and
8:35
paste it into the cloudflare service
8:38
worker
8:40
if you head back to cloudflare
8:42
and do a quick edit
8:45
on your worker
8:48
and here you're just going to select all
8:50
and paste in the code from the stack
8:55
and you're going to go save and deploy
8:59
so you see here it was last deployed a
9:00
minute ago we are all good to go
9:03
all right so now we can go back to edit
9:07
mode
9:07
turn off the show Cloud for code and now
9:11
we can start building out what we want
9:12
this to look like
9:14
so first thing we're going to add here
9:16
is a status
9:19
and then I'm also going to add a button
9:24
and I want to add The Purge
9:27
perfect so now we have all three here
9:31
and inside of the dev mode status we
9:35
actually have some options for setting
9:37
label classes and the status classes so
9:40
the label is the stat the word status
9:43
here
9:43
and the status is what pops up
9:47
when you it checks for status whether
9:49
it's on or off
9:50
now if you want to change the language
9:52
out
9:53
on the stack we have the ability in the
9:57
primary cloudflare stack
10:00
so you'll see here that you can change
10:02
what loading means status
10:04
you know if Dev mode is on if dead mode
10:07
is off
10:08
to turn it off or to turn it on so in
10:11
this case I'm actually going to do some
10:12
customizing so here
10:15
we're gonna go where it says status and
10:17
we're actually going to say
10:20
staxweaver.com
10:25
and then
10:27
for on I'm actually going to change this
10:30
to
10:32
Dev mode on and Dev
10:37
mode off
10:41
perfect
10:43
and then turn Dev mode off or turn Dev
10:45
mode on and Purge cache that's all
10:48
perfectly fine
10:51
all right so let's go back to status now
10:54
what's really cool is if you're using
10:55
Foundation this supports the utility
10:57
classes that you can get out of
10:59
foundation so for instance I want my
11:01
label to be in H5
11:04
maybe an H6
11:06
and I'll do my status as an H6 as well
11:09
so now you see here that it's actually
11:11
taking on an H6 formatting just by
11:14
adding in those utility classes
11:17
now as for the button I want this to be
11:20
a small
11:21
and I want it to be radius
11:27
or maybe a large
11:29
no let's go smell
11:35
and the same thing for The Purge cache I
11:37
just want that to be small and have a
11:39
radius
11:41
perfect let's have a look at that
11:46
I don't think small is small enough so
11:49
maybe let's do tiny
11:55
yeah Tiny's good
12:01
perfect
12:03
so now we've got the status all set up
12:05
so now let's look actually at the button
12:08
so there is some information here on the
12:12
special classes that come with this
12:14
button stack
12:16
you see that it says CF button targets
12:19
just the button
12:20
CF Dev status button on targets the
12:23
button when Dev mode is on TF status
12:26
button off targets the button when the
12:27
dev mode is off
12:29
and then you have some options here to
12:31
preview Dev mode on in Dev mode off this
12:34
is for is allowing you to have a look at
12:35
the different button statuses what they
12:38
look like when they're on and off so
12:39
right now it's set just for blue that's
12:42
the standard so if we actually bring in
12:46
some swatches
12:52
and I want to Target let's see here the
12:54
background when it button is off so
12:58
we'll Dev mode status off
13:06
that Bunch button off and then we're
13:08
going to choose a color
13:10
and we're going to go with
13:12
for this
13:14
Dev mode is off we just want it to be
13:16
green
13:20
now because of that we also want to
13:22
change the font color
13:25
and we want it to be black
13:28
so green means it's off so cache is
13:31
working everything's good
13:33
now we want to work on the other button
13:35
if the status is on
13:38
if we go back here we'll copy the
13:43
status is on add another background
13:51
now see here that
13:53
turn Dev mode off is red
13:55
we have a look at that
13:58
I'll show you what the buttons would
14:00
look like so the green of course means
14:04
that Dev mode is off which means cache
14:08
is working and turn Dev mode off is red
14:11
because the current status of it is on
14:14
so with this
14:16
if the status came back that Dev mode
14:18
was off you'd get green buttons good to
14:21
go
14:22
and then if it came back as the mode is
14:25
on you'll get a red button that says to
14:27
turn it off now let's look at
14:29
customizing the status stack let's do
14:31
the same thing that we did to the dev
14:33
mode button let's turn on the preview
14:34
for Dev mode on and off so we can see
14:37
what that looks like but we're going to
14:39
change the font color
14:42
when Dev mode is off we want it to be
14:44
green
14:45
and now we're going to customize it when
14:46
it is on
14:52
now we've customized the off and on
14:55
statuses of the status as well as the
14:58
button now what I also want to do is I
15:00
do want to have this the stack on the
15:02
dashboard when I sign in I'm just going
15:04
to copy the stack quickly
15:06
and go into my admin dashboard
15:13
and if we have a look at my website
15:17
on the dashboard I want it right up here
15:20
in the admin area
15:24
I'm going to paste this in
15:27
and what we're going to do is duplicate
15:29
this column
15:31
and delete that out
15:36
let me drop this in now I don't want to
15:40
actually change any of the
15:44
I don't want the button or anything here
15:45
I just want the status on or off now I'm
15:48
just going to go back and grab our
15:51
swatches
15:54
maybe if Dev mode is on let's make this
15:58
a little bit different of a color make
15:59
it Orange
16:00
yeah let's do that on the other one as
16:03
well
16:04
those changes there we'll just do a
16:06
quick preview
16:08
see what this would look like
16:11
let's do a quick publish and see how
16:14
this looks
16:16
now we're just going to empty the cache
16:18
before we refresh the page
16:20
and let's see how the stack looks
16:23
so we're just going to load up the
16:25
settings page and see if it is working
16:27
and we can see here Dev mode is off and
16:29
if we press the button Dev mode turns on
16:32
and we can verify that just by
16:33
refreshing the cloud fire page and we
16:36
can see here that of course Dev mode is
16:38
now on
16:40
now if we want to see the status we put
16:42
on the dashboard we'll just go to the
16:44
dashboard and refresh and we'll see that
16:46
Dev mode is also on
16:49
and if we want to double check that the
16:51
status will function we can turn Dev
16:53
mode off manually refresh and indeed Dev
16:56
mode is now off just for fun I'm just
16:58
going to change some of the language
16:59
settings in here
17:01
and it's going to instead of it saying
17:02
sex waiver I want to say Dev mode and I
17:04
want it to say is on or is off and with
17:07
those changes here you see that Dev mode
17:09
is off
17:11
and if we want to go change that we head
17:13
over to settings
17:15
go down to our admin
17:17
and we can go turn Dev mode on all of
17:22
this will happen instantly and this
17:25
saves you from having to log into
17:26
cloudflare to toggle this mode you can
17:29
now just do it straight in from your
17:30
website
17:31
and of course after you've made all the
17:33
changes to your website you just click
17:35
on The Purge cache this will initiate
17:37
the removal of the cache on your
17:39
cloudflare servers
17:41
I hope you enjoy cloudflare Dev tools if
17:43
you have any questions reach out on the
17:44
community or email me at support
17:46
staxweaver.com
17:55
[Music]
17:56
foreign
17:57
[Music]