Build.snapcraft.io Badge Caching


#1

Hello all,

It looks like the build.snapcraft.io badge has some caching on it, meaning that the image that shows up when I open a repository on Github is not necessarily current. (Specifically, I’ve seen it claim a build is in-progress when it completed several minutes earlier.)

Wasn’t sure exactly where to bring this up, so I thought I’d post here. :slight_smile:

Dan


#2

I think you’re mistaken, snapcraft badges seem to explicitly send a Cache-Control: public, max-age=0 header which means “dont cache this please”

Github actually caches images in the readme files, if you look at where the images are loaded from you will see they are coming from a github hosted domain where they proxy the image download. I think it’s for privacy reasons and to stop people tracking view counts of repositories.

Anyway, blame github :slight_smile:


#3

I think that the build.snapcraft.io servers are using a format for the Cache-Control header that the Github servers don’t understand; specifically in this issue: https://github.com/github/markup/issues/224#issuecomment-33454537 it is mentioned that the Cache-Control header should be specifically:

Cache-Control: no-cache

I’d be happy to file an issue for this somewhere, not sure which repo is used for the build.snapcraft.io servers.


#4

#5

@Odd_Bloke @ijohnson I’ve created the issue for you https://github.com/canonical-websites/build.snapcraft.io/issues/1101

We’ll look at getting that fixed in the next couple of weeks for you


#6

Thanks for filing that issue.


#7

The issue has been fixed in https://github.com/canonical-websites/build.snapcraft.io/pull/1119 and will be deployed in due course!