staticallyio / statically

The CDN for developers.
https://statically.io
MIT License
585 stars 91 forks source link

Statically not updating files when updated on gist. #71

Closed cysabi closed 4 years ago

cysabi commented 4 years ago

The original Github Gist link:

https://gist.githubusercontent.com/LeptoFlare/cd471d7b29902b5d36eb48e64e62d8d1/raw/style.css

The statically.io link:

https://cdn.statically.io/gist/LeptoFlare/cd471d7b29902b5d36eb48e64e62d8d1/raw/style.css

fransallen commented 4 years ago

Hi @LeptoFlare, CDN will cache Gist for 1 day. If you wish for some more shorter Cache-Control you can use ?dev=1 after the URL, it will give you a CDN cache for only 5 minutes.

I hope this helps.

cysabi commented 4 years ago

I just did this, and I'm getting an error saying "Failed to load resource... 404"

fransallen commented 4 years ago

Can you confirm is https://cdn.statically.io/gist/LeptoFlare/cd471d7b29902b5d36eb48e64e62d8d1/raw/style.css?dev=1 returned a 404 page for you?

cysabi commented 4 years ago

Ah, I added .min. to automatically minify it.

I guess those 2 do not work in conjunction

cysabi commented 4 years ago

Can confirm it works properly without .min

cysabi commented 4 years ago

However, if you see my style.css I have

@import url('style.font.css');
@import url('style.a.css');

It seems these files still seemed to be cached from more than 24 hours ago

cysabi commented 4 years ago

image I can confirm at-least that those 2 files ignore the ?dev=1 rule

fransallen commented 4 years ago

Yes, .min only for production needs.

To get a shorter CDN cache, you also need to set dev=1 to other files, because they are different requests.

cysabi commented 4 years ago

Those files are not loaded from CDN, they are loaded from locally. They are a path to another file in the same gist

fransallen commented 4 years ago

I mean you have to use something like this:

@import url('style.font.css?dev=1');
@import url('style.a.css?dev=1');
cysabi commented 4 years ago

Ah, I see.

Works perfectly! Thank you!