Needing help with caching workflow

Hi! I am a web designer just now diving into development. I have created a site but am trying to implement caching and am just totally unsure what I need to write out for my .yml file and would love someone’s help just to copy and paste the proper workflow. I would love for the entire site to be cached on a daily basis.
Thanks so much to anyone who can help.

My files:

The caching code I found:

  • name: Cache
    uses: actions/cache@v2.0.0

    A list of files, directories, and wildcard patterns to cache and restore


    An explicit key for restoring and saving the cache


    An ordered list of keys to use for restoring the cache if no cache hit occurred for key

    restore-keys: # optional

Could you explain what you want to cache, and for what purpose? From a glance at your repository it seems to be all static files, no need for a build that could be sped up by caching.

Thanks so much for the reply! I’m not totally sure, I ran my site through a speed test and the only negative review I received was caching. But maybe I am mistaken, very beginner at this.

Ah, then it’s probably related to HTTP caching, which means the browser keeps data locally (check this MDN article for a detailed explanation). I took a quick look and saw that the site sends a cache-control: max-age=600 header, which means the browser cache is valid for only up to 10 minutes. Pretty short, but I assume if it was longer Github would get a lot of complaints about people not seeing updates to sites. :wink:

However, while checking that I also saw the most likely reason for your site loading slowly: Just loading the homepage transfers over 65MB! And about half of it is Hobbies.gif. Transferring this much data will take a lot of time, except for the lucky few with really fast internet access. For people with a regular DSL connection (16Mbit/s) loading just 2 MB will take at least a second, if there’s nothing else going on.

If you want to make your site faster use smaller (as in file size) images, and maybe less animation. Also look at compression settings when creating the images, JPEG at the scale of most of your GIFs (around 900x900 px) can have decent quality at just about 100kB.

Additionally, using this much animation is an accessibility issue. For me it’s “just” extremely distracting, which makes reading difficult and I want to leave the site quickly. Some people get downright dizzy (and maybe other things I don’t know about).

I hope this helps! :slightly_smiling_face:


Sorry for the delay! Yes it did, thank you so much for your time.

1 Like