js-org / js.org

Dedicated to JavaScript and its awesome community since 2015

Home Page:https://JS.ORG

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Support for pages.dev

shoaib-jamal opened this issue · comments

Hello, are cloudflare pages supported by js.org?
pages.dev

It should work, though I don't think we have anyone currently doing it. If it doesn't for any reason, I can contact folks at Cloudflare to figure out making it work hopefully.

You cannot CNAME to Workers, as far as I know.

Okay, thankyou.

Hey, is it possible to add Cloudflare's free Compression/Cache to a js.org subdomain?
I am deploying on Netlify and experiencing high bandwidth usage - Since js.org uses cloudflare at back is it possible that caching and compression to be enabled there for rebornxp.js.org subdomain?

All js.org subdomains go through Cloudflare's proxy by default and use their standard caching settings. You can request the proxy is disabled if you wish by adding // noCF to the entry in cnames_active.js. We cannot customise the cache rules etc. on a per-subdomain basis.

I don't want to disable the proxy but I wanted to enable compression type something.

Pretty sure Cloudflare does compression on the fly where it can.

curl -s -H "Accept-Encoding: gzip" https://status.js.org | gzip -d

<html lang="en">
<head>
    <title>HTTP Status Codes</title>
...

So isn't there any way to reduce bandwith load on my netlify deployment?

Not beyond what is already being provided. I'd recommend looking at getting your own domain if you need to tune caching etc. more.

Hello, sorry again but now I have compiled the SSR to a static html and I'm now planning to again host on gh-pages since now it's static html. The problem with gh-pages is about the relative paths, the repo is being excluded for ex. "/css/" is being treated as https://user.github.io/css instead of https://user.github.io/repo/css

I was asking it since if I deploy it on js.org subdomain, will this problem occur? Like CNAME points to that same gh-pages domain.

@shoaib-jamal If you use CNAME on your user-repo (the repo has to be named .github.io) other repositories of your user will be accessible via path if you use project repo they won't. But why not just try out but all this back and forth.

@MattIPv4 Regarding CF workers: I think it does work to add CNAMEs for them. I've added one for JS.ORG like someworker.jsorg.workers.dev and it does work. I don't see why it shouldn't work for other/external workers.

Oh interesting, I was not aware you could CNAME to a worker, I thought you had to register the route with the worker, and to do that you needed to control the zone in Cloudflare.

@indus Ahh thankyou, let me just try it, and also please confirm about the cloudflare pages (not workers) that if they support js.org sub. I tried aading it and it asked for NS verification.

I've opened the PR please merge it & if the relative path issue persists I'll consider moving to cloudflare pages, can you also confirm if it can be done with CNAME without NS

@shoaib-jamal I only have the CF account for JS.ORG and it may differ to an external account. If you are forced to make a verification with a NS record it won't work. If a TXT record is enough it should work.

What is the problem with fixing the relative paths. Why has the host match the paths you have set up and not make the paths match to the hosting you have? Sorry if I'm I missed something but I really don't get it...

Hey, sorry for confusion, I'm experiencing this problem: https://maximorlov.com/deploying-to-github-pages-dont-forget-to-fix-your-links/

My project is based on SvelteKit and it builds the static html in a way that the content is served from root domain. But gh-pages the root path isn't there, instead it ends with a dir of repo name. Thats why it can't fetch assets and returns with 404.

@indus Looks like you have merged the CNAME gh-pages because the subdomain is serving from gh pages instead of netlify, but in cnames-active.js I still see the netlify CNAME.

Finally I've come to conclusion that I'll host it on my friend's VPS, on his subdomain, I was asking if it's possible to CNAME that subdomain to js.org. If yes, I am creating a PR, please merge it.

I found on a website: Using a CNAME record for a subdomain that already has an A record might not work reliably due to DNS specifications. While some DNS providers may allow this configuration, it's generally not recommended and might lead to unexpected behavior or DNS resolution issues. Therefore, it's advisable to directly use an A record pointing to the IP address instead of relying on a CNAME record in this scenario.

So the question is will it work? I have opened a new PR, If you're sure it will work please merge it otherwise fallback to the netlify one (rebornxp.netlify.app), it is configured for working with js.org, I'll move to a paid plan there, and please do it ASAP since my visitors are questioning about it - don't wait for my confirmation.

@indus @MattIPv4 Again, sorry for too much confusion and issues.

CNAME records are very standard, I'm not aware of any DNS provider that does not support/resolve then.

@indus I think its not possible to CNAME an A Record. Please fallback to netlify.

That's not how DNS works, the entire purpose of a CNAME is to alias one subdomain to another that already has an A record, but sure, you're welcome to switch back to Netlify. I'm going to close this issue now, as we're really not getting anywhere.