u/Double-Journalist877

▲ 4 r/BDDevs+1 crossposts

Shared Cache for ISR pages?

Good day folks,

I have a problem i want to solve. I have a next.js app, that I'm deploying as 4 instances behind an apache/nginx proxy. I am trying to reduce revalidation frequency of my ISR pages across 4 instance. It makes no sense for all 4 instances to regenerate the pages by themselves.

The approach I've been researching is, using my already available redis server, to cache ISR pages based on revalidation time set in said ISR pages. So if instance A revalidates a page, it is cached and served by other 3 instances. Then, when that cache expires, the next time an instance gets a request, that instance X will regenerate the page and put it back into redis cache for other instances to serve.

My initial thought is to write up a middleware in next.js, to intercept when an ISR page is being served, and check if there is a cache. Idk if just caching the response from a revalidated page request would be enough.

I wanted to ask the developers if they've come across this and what their solution looked like.

reddit.com
u/Double-Journalist877 — 29 days ago
▲ 7 r/BDDevs

For context, I live (and have been for a long time) abroad. Me and a couple of other senior software engineers are designing a platform and service designed for South Asian countries. This service requires cloud hardware infrastructure and doing it over managed cloud service is a money pitfall that we don't want to go into, mostly because our team is experienced enough to setup the infrastructure ourselves. We're currently using Western cloud infrastructure with Google and AWS but we want to eventually move to our own server infrastructure.

We first thought about using Malaysian datacenters but we want as much of the payments to go into Bangladeshi economy, if we can, even for services targetted for outside of Bangladesh.

Requirements

We're looking for a datacenter in Bangladesh, preferably outside of Dhaka, that can provide us with custom hardware setups, with high BDIX bandwidth and private networks.

Our usecase requires:

▶️ Expertise with AI tagerting hardware and understanding of high throughput systems, not just slap together surface understanding of computer systems and architecture.

▶️ American/Chinese AI GPU systems with DDR5 RAM and server-grade processors, to fine tune and run Neural Network models (NN), Natural Language Processing (NLP) and Large Language Models (LLM).

▶️ Critical and reliable connectivity to financial institutions such as Dhaka Stock Exchange.

▶️ Customised internet traffic bandwidth, as we'd setup a single gateway that connects to the internet.

▶️ Highspeed private networks connecting all rented servers as only gateway server will handle outside network traffic.

To the main question, has anyone had the experience of setting up a cloud infrastructure using a company that operates datacenters in Bangladesh? Any suggestions?

reddit.com
u/Double-Journalist877 — 1 month ago