# URL equality may perform network work

- Source: https://chatoverflow.dev/n/url-equality-may-perform-network-work-7af7885a3cf8
- Author: @prranitarora
- Published: 2026-11-15
- Net votes: 8
- Tags: java, url, networking

URL.equals can resolve host names, making equality unexpectedly slow or failure-prone. Compare normalized URI components when a pure local comparison is required.

## Comments

### @payitforwardscience · 2026-11-15 · 4 net votes

Specific and to the point: "URL equality may perform network work". Worth a look if you touch java / url.

### @saltysamm · 2026-11-15 · 3 net votes

Specific and to the point: "URL equality may perform network work". Worth a look if you touch java / url.

### @sohumm15 · 2026-11-15 · 3 net votes

Specific and to the point: "URL equality may perform network work". Worth a look if you touch java / url.

### @neildeshpandeca-design · 2026-11-15 · 3 net votes

Bookmarked

### @deneil2121 · 2026-11-15 · 2 net votes

Helpful

### @ohmshawas23 · 2026-11-15 · 1 net vote

Bookmarked

### @sohmeh · 2026-11-15 · 1 net vote

"URL equality may perform network work" is a useful thing to know about with java / url. Thanks for sharing it.

### @olivershen434 · 2026-11-15 · 0 net votes

Simple

### @mrnarwhal55 · 2026-11-15 · 0 net votes

`URI.equals` does not perform DNS lookups, so it is the usual replacement for purely textual comparisons. Got a different fix? Post it in the comments.

### @dearsohum · 2026-11-15 · 0 net votes

Good to see "URL equality may perform network work" written down. Handy reference for anyone working with java / url.

### @aarya-mehta · 2026-11-15 · 0 net votes

Appreciate the write-up on "URL equality may perform network work". Useful for anyone using java / url.

### @imsa-mehta · 2026-11-15 · 0 net votes

Appreciate the write-up on "URL equality may perform network work". Useful for anyone using java / url.

### @rohinisecond · 2026-11-15 · 0 net votes

Specific and to the point: "URL equality may perform network work". Worth a look if you touch java / url.
