Jump to content
thirty bees forum

datakick

Administrators
  • Posts

    2,866
  • Joined

  • Last visited

  • Days Won

    426

Blog Comments posted by datakick

  1. 3 hours ago, wakabayashi said:

    @datakick Do you use any expires values? I followed some examples from google, but can't make it work. Google PageSpeed Insights always says, there aren't set. How would this done be correctly?

    location ~* \.(woff)$ {
    	expires 300d;
    	add_header Pragma "public";
    	add_header Cache-Control "public";
    }

    I tried this one. I am using nginx and cloudflare. Not sure if cloudflare has any impact on that 🤔

    Never played with this one. But I assume cloudflare will modify these nginx headers, since it's caching layer.

    you can see diffs by requesting 

    curl -I https://www.domain.com/.../file.woff
    
    vs
    
    curl -I 199.199.199.199/.../file.woff

    I get 

    HTTP/2 200
    date: Wed, 03 Aug 2022 14:32:20 GMT
    content-type: font/woff
    content-length: 90412
    last-modified: Tue, 19 Feb 2019 13:44:42 GMT
    etag: "5c6c084a-1612c"
    cache-control: max-age=31536000
    cf-cache-status: HIT
    age: 3
    accept-ranges: bytes
    expect-ct: max-age=604800, report-uri="https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct"
    report-to: {"endpoints":[{"url":"https:\/\/a.nel.cloudflare.com\/report\/v3?s=VUCoNPsUr2WZxf4%2Bsd0XJgcgwMq4y7hqrey0LQG1a9Y2Gtno7j07DYM01T3EeJ9OsEyZp%2BLMbH%2Bwqf03i%2BNN1etvVz6JZ6w61KX1O3G7WhXfPucFeYG9h3SC2Xxdam4%2BMNsowbvT8d0%3D"}],"group":"cf-nel","max_age":604800}
    nel: {"success_fraction":0,"report_to":"cf-nel","max_age":604800}
    server: cloudflare
    cf-ray: 734fc316f984b333-PRG
    alt-svc: h3=":443"; ma=86400, h3-29=":443"; ma=86400

    vs

    HTTP/1.1 200 OK
    Server: nginx/1.15.8
    Date: Wed, 03 Aug 2022 14:33:17 GMT
    Content-Type: font/woff
    Content-Length: 90412
    Last-Modified: Tue, 19 Feb 2019 13:44:42 GMT
    Connection: keep-alive
    ETag: "5c6c084a-1612c"
    Accept-Ranges: bytes

    As you can see, cloudflare adds cache-control header itself.

    • Thanks 1
  2. I don't really care that cloudflare doesn't support this header, as it's not used in decision process at all. If browser send information that it can handle webp format, it will receive webp images, otherwise it will receive jpeg. For older browser this means they will always receive jpeg. 

    If tb webp feature is used (and fixed), it will work regardless if you use cloudflare or not. I

  3. 5 minutes ago, datakick said:

    There's no need for any of this.

    Thirtybees generates different html content for different browsers. If browser supports webp, the image links in the page will have .webp extension, otherwise image links will have .jpg extension. 

    Since dynamic html is not cached by cloudflare, there's no issue at all. Works like a charm

    Oh, I take this back. There's a bug in thirtybees core that actually does not do the check correctly -- so you are right, this config can fail for some old browsers.

×
×
  • Create New...