Urgent.News

What's breaking now, across thousands of outlets.

Tech

Server-Side Rendering on Country Subdomains: What We Got Wrong First

Server-Side Rendering on Country Subdomains: What We Got Wrong First 24ad.info is a classifieds site where every country has its own subdomain — pl.24ad.info , de.24ad.info , gb.24ad.info — all served by one app. The frontend is a React 19 single-page app built with Vite, running on Express behind Caddy, with everything behind Cloudflare. A single-page app has a well-known weakness: the first…

The wire story covers the challenges faced by 24ad.info, a classifieds site with country-specific subdomains. Initially, the site struggled with ensuring proper first HTML responses and correct metadata for each country subdomain.

In April, they adjusted canonical URLs to match the subdomain the request originated from, and implemented a geo-redirect to send visitors to their respective country's subdomain. However, this redirect became a permanent 301 instead of the temporary 302 initially used.

In May, they attempted to inject data into the first HTML response for improved performance. While this worked well for listing pages, it caused issues on the home page where listings were country-specific. The injected data did not apply to the home page, leading to a mix of UK and global listings for users on their own country's home page. They quickly removed this feature.

Currently, the site renders the home page, listing pages, and category pages with custom metadata and initial data injected by the server. All other routes use the standard app template. Static assets are served directly from Caddy with long-term caching. The site block covers both the main domain and subdomains using a wildcard certificate.

The key takeaways from the story are that canonical URLs should be specific to each subdomain, the geo-redirect should exclude search engine bots, logged-in users, and users who explicitly select the global view, and pre-rendered data must be scoped to match the live page's country.

Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.

Read the original at dev.to →

More in Tech

Animate Text on Scroll with SplitFX in 3 Simple Steps

Text animations can make a website more engaging by revealing content as visitors scroll through the page. These effects can draw attention to headings, section titles, and other important content…

  • Install SplitFX via npm or load from CDN
  • Create SplitFX instance and define animation
  • Use animateOnScroll() to trigger animation

A PostgreSQL mirror that loses nothing, even when the load fails

You have an application database and you want a copy of one of its tables somewhere else, for reporting. Copying the whole table every night works until the table gets big, or until you need the…

  • PostgreSQL mirror reliably copies table changes using logical replication
  • Hydra ETL tool leverages built-in PostgreSQL replication features
  • Mirror maintains integrity during failures by applying upsert mode

Your PyTorch Code on Trainium: What Actually Breaks

AWS Trainium chips cost less per training run than equivalent GPU instances, but historically you had to rewrite your training loop around the Neuron SDK. TorchNeuron changes that.

  • Trainium offers lower costs per training run compared to GPU instances
  • TorchNeuron simplifies PyTorch code porting to Trainium
  • Unsupported operations include dynamic control flow and sparse tensors

More from Monday 9 November →