-
Posts
2,866 -
Joined
-
Last visited
-
Days Won
426
Content Type
Profiles
Forums
Gallery
Downloads
Articles
Store
Blogs
Blog Comments posted by datakick
-
-
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.
- 1
-
This Vary problem would occur when your page contains image url like http://www.domain.com/my-image, and this url returns different content for different user agents. That's not the case with thirtybees. We have different urls like http://www.domain.com/my-image.webp and http://www.domain.com/my-image.jpg so there's no ambiguity for cloudflare at all.
-
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
-
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.
-
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
-
I use free plan + native thirtybees webp support. Cloudflare has no problems with caching .webp.
-
39 minutes ago, michael said:
Yes, it does. No modules are necessary. Just theme support is required
-
Thanks @Petter for the tip, I'll definitely try this nginx extension myself
-
Well, I don't see what apache brings to the table. Nginx can take care of url rewriting, ssl, gzip, serving static assets, etc. There's nothing left for apache to handle. Unless you need some special mods (mod_security, etc). I don't need those, so I'm perfectly happy to not use it.
-
Great to have some SysAdmin aboard, that's another group of problems this forum can help with now!
nginx configuration for thirtybees
in Datakick's Tips and Tricks
A blog by datakick in General
Posted
yeah, absolutely. Thanks for bringing this to my attention.