Live data from Hacker News

Shrinking my static site

hampton.pw

101–107 of 107 posts

Re: Shrinking my static site

#101
post #91

Earlier quoted context omitted.

(Not the one you replied to, but) I was actually affected — but my nginx setup as ingress controller in kubernetes worked just fine, and automatically handled everything. I actually read in the news about it later, but my systems never went down. And in contrast to caddy, my setup actually follows the DNS and URL standards, and actually handles Absolute URIs correctly, in contrast to e.g. http://caddyserver.com./ , w…

Do you have a practical example where that matters? Because I've never seen anyone link to a page with a trailing . in the domain.

If you have a situation where due to your search domain, e.g. corp.com, both exampleA.tld and exampleA.tld.corp.com would be valid DNS resolutions.

If you’re already using something like kubernetes, which does such resolutions, this can actually become an issue. e.g. in the cluster ServiceA can call ServiceB by navigating to http://serviceb/, and if the name of serviceb overlaps with an actual real-world domain, you need to use http://serviceb./ to ensure you call the outside-world site.

Re: Shrinking my static site

#102
post #44

This approach is akin to installing all of the build tooling inside of Docker, then generating the build artifact. I'd think it'd be even slimmer to generate the build artifact first, then just copy that into the container. Is there an advantage to building inside of Docker?

> I'd think it'd be even slimmer to generate the build artifact first, then just copy that into the container.

That's what this is doing. It creates builder containers, uses them to make the artifact and copies it in:

    FROM nginx:1.17.10-alpine
    RUN rm -r /usr/share/nginx/html/
    COPY --from=builder /app/_site/ /usr/share/nginx/html/

    EXPOSE 80 
The final image is nginx with the static files copied over.

Re: Shrinking my static site

#103

Earlier quoted context omitted.

Do you have a practical example where that matters? Because I've never seen anyone link to a page with a trailing . in the domain.

If you have a situation where due to your search domain, e.g. corp.com, both exampleA.tld and exampleA.tld.corp.com would be valid DNS resolutions. If you’re already using something like kubernetes, which does such resolutions, this can actually become an issue. e.g. in the cluster ServiceA can call ServiceB by navigating to http://serviceb/ , and if the name of serviceb overlaps with an actual real-world domain, you…

Okay. As far as I can tell, Caddy can be configured to handle that, you just need to tell it to. Have you tried to configure Caddy to accept requests to hostnames with a trailing dot recently?

Re: Shrinking my static site

#104
post #72
post #21

Earlier quoted context omitted.

The problem with JS ecosystem is less about size and more about the number of files.

There are real problems with NPM, like the proliferation of packages that include things they shouldn't (babel included a picture of Guy Feiri for a while...) but the simplistic "there's a lot of files" argument is nonsense. If you need a lot of files then you need a lot of files.

> babel included a picture of Guy Feiri for a while...

I refuse to believe that there are real people so eager to jump on the JS hate bandwagon that they unironically believed every word of an obviously satirical article.

(babel has never included a picture of Guy Fieri.)

Re: Shrinking my static site

#105

Earlier quoted context omitted.

If you have a situation where due to your search domain, e.g. corp.com, both exampleA.tld and exampleA.tld.corp.com would be valid DNS resolutions. If you’re already using something like kubernetes, which does such resolutions, this can actually become an issue. e.g. in the cluster ServiceA can call ServiceB by navigating to http://serviceb/ , and if the name of serviceb overlaps with an actual real-world domain, you…

Okay. As far as I can tell, Caddy can be configured to handle that, you just need to tell it to. Have you tried to configure Caddy to accept requests to hostnames with a trailing dot recently?

Well that’s the issue. I need to access external websites that way. You could imagine it as a user entering a URL, and a service fetching that URL. To ensure this service doesn’t accidentally fetch an internal site, it transforms the URL to one with a . at the end.

So, I need all websites intended to be fetched this way to support the proper DNS RFCs.

Ever since Caddy and Traefik became a thing my tool has stopped working for more and more non-standard webpages.

Even caddyserver.com itself is broken.

In the end, I’ve simply chosen not to use caddy or traefik based websites.

Re: Shrinking my static site

#106
post #72

Earlier quoted context omitted.

There are real problems with NPM, like the proliferation of packages that include things they shouldn't (babel included a picture of Guy Feiri for a while...) but the simplistic "there's a lot of files" argument is nonsense. If you need a lot of files then you need a lot of files.

> babel included a picture of Guy Feiri for a while... I refuse to believe that there are real people so eager to jump on the JS hate bandwagon that they unironically believed every word of an obviously satirical article. (babel has never included a picture of Guy Fieri.)

It might not have been a picture, but there was an ASCI art of his face that got checked in.

https://github.com/babel/babel/blob/f36d07d30334f86412a9d277...

Re: Shrinking my static site

#107
post #106

Earlier quoted context omitted.

> babel included a picture of Guy Feiri for a while... I refuse to believe that there are real people so eager to jump on the JS hate bandwagon that they unironically believed every word of an obviously satirical article. (babel has never included a picture of Guy Fieri.)

It might not have been a picture, but there was an ASCI art of his face that got checked in. https://github.com/babel/babel/blob/f36d07d30334f86412a9d277...

It was checked in as a humorous response to the very satirical article I'm talking about, and never actually published to the package registry.

But again, people are so ready to froth at the mouth wherever JS is even mildly concerned that I really shouldn't be surprised they'd take a meme that lasted for a handful of days seriously.

Post reply on HN