News for hackers. Stuff that matters.
Re:Cloudflare Pages is now Generally Available by trinovantes on Monday April 12, 2021 @09:18AM (#26779071)
Been using it for a few weeks on one of my side projects. Overall pleased but did encounter some problems:

- Builds randomly fail to deploy and without notification (had to push a random commit to master to trigger a new build)

- If using custom domain, there's no way to redirect myproject.pages.dev to myproject.com so I had to use a <link rel="canonical"> on the off chance Google finds my pages link. I also had to use a page rule to redirect all traffic to www

- I'm not exactly sure how (if it's even possible) to set up a staging environment so that every push to master doesn't automatically deploy to production

- All the cache-control headers are "max-age=0, must-revalidate". I had to create another page rule to edit this to 1 year max age for assets that already have contenthash appended to their file names

Re:Cloudflare Pages is now Generally Available by rita3ko on Monday April 12, 2021 @09:51AM (#26779417)
Hey there. I'm the PM for Pages. That's fair feedback (though a lot could have changed even in the past few weeks, so I would recommend taking another look)

- It's hard for me to tell what's causing the issue (the build logs should give an idea of at least at which stage). One thing we've added over the course of the beta is connection to GH comments, which requires a new type of permission. So that might be causing the failure, but also, failed builds should result in a comment (and email) for notifications, depending on your GH settings. All of that said, my email is rita at cloudflare if you want to forward me more details, I can help look into it.

- Creating a canonical notion of your domain is something we're thinking about. Right now the preview links will set X-Robot-Tag so they can't be crawled but yeah, ideally we want to give you a way to remove myproject.pages.dev if you're not using it

- The cache-control settings are intended to keep your site from serving stale content by relying on etags — your browser should still serve from cache if the asset hasn't been updated. On the Cloudflare site, we have much longer TTLs.

Anyway, thanks for trying Pages! We're continuing to iterate on it, even after GA so should only be getting better :)

(edit: spacing :P)

Re:Cloudflare Pages is now Generally Available by ignoramous on Monday April 12, 2021 @11:21AM (#26780373)
It is great that pages.dev is now GA: That happened f.a.s.t! Love the redirect feature; excited about the upcoming integration with Workers, KV, and Durable Objects.

The only thing missing is different build commands per branch and ability to exclude certain branches from builds altogether.

BTW, now that pages.dev is GA, has the 1xxx errors with Workers when Pages are on a different subdomain, fixed? Ref: https://community.cloudflare.com/t/workers-recently-receivin... | Ticket: 2109407

"Jam harder" a nod to jam.dev? (:

Thanks.

Edit: Might want to update https://developers.cloudflare.com/pages/platform/known-issue...

Re:Cloudflare Pages is now Generally Available by rita3ko on Monday April 12, 2021 @12:48PM (#26781704)
jam.dev are good friends of ours (both founders ex-cloudflare and some of my good personal friends!) :) but was thinking about it more as a play on jamstack.

re: excluding branches — we're actively looking into it!

and yes, that error has been fixed AFAIK, but let me double check.

Re:Cloudflare Pages is now Generally Available by sebseb111 on Friday April 16, 2021 @04:19AM (#26831078)
Cache control could be in config file like in firebase - for example gatsby provide example cache config for firebase:

``` { "hosting": { "public": "public", "ignore": ["firebase.json", "*/.", "*/node_modules/*"], "headers": [ { "source": "*/", "headers": [ { "key": "cache-control", "value": "public, max-age=0, must-revalidate" } ] }, ```

It would be great to add "clean urls" - removing trailing slash for directory urls, like in firebase: ``` "hosting": { // ...

  // Removes trailing slashes from URLs
  "trailingSlash": false
} ```

I have also a lot of problems with builds. I tried 2 ways od deploying static pages to Cloudflare:

1) gatsby build 2) fully static page (gatsby build on my local computer and push "public" dir to github repo

both ways are generating error:

08:35:00.770 Finished 08:35:01.232 Deploying your site to Cloudflare's global network... 08:54:16.759 Failed due to an internal error

it looks like a hidden limit - build timeout 20 minutes? My website has 13000 small files (html, js, css, png, webp - max file size is about 300kB) and I cant deploy it because of this error

I even limited image sizes from 1600px to 800px, and limited files to about 10000 files and still I get error

I have another website with 11000 files and I use "gatsby build" - and build is successful for 1 of 5 tries...

Re:Cloudflare Pages is now Generally Available by fastball on Monday April 12, 2021 @10:20AM (#26779735)
To add to this, when I was trying out CFP, I found it annoying that there was no explicit "build" button. I changed the default branch that I wanted CF to build from, but it didn't automatically make a new build. And there was no button I could click (like there is on Netlify) to say "rebuild now".
Re:Cloudflare Pages is now Generally Available by papertokyo on Wednesday April 14, 2021 @08:23PM (#26814813)
+1 for this. Netlify has it and I have used it many times to redeploy a site after changing some config settings (e.g. env vars, build commands). Having git push as the only deployment trigger is a pain in these scenarios.
Re:Cloudflare Pages is now Generally Available by ngrilly on Monday April 12, 2021 @02:31PM (#26783204)
Do you plan to improve Cache-Control to make cache busting possible? Otherwise, even if the browser has the resource cached, there will still be a round trip to revalidate.
Re:Cloudflare Pages is now Generally Available by rhaksw on Tuesday April 13, 2021 @01:11AM (#26788319)
On Netlify I set headers in a config file [1]. With Pages, is the only free option to use the 3 Page Rules?

[1] https://github.com/reveddit/reveddit/blob/fdf159be0e98dbfba6...