Website Without PHP
US
Menu

Edge computing

Also known as: edge, edge function

Edge computing means running small bits of code on servers close to the visitor, instead of on one central server far away.

Static sites Last updated:

Edge computing means running small bits of code on servers close to the visitor, instead of on one central server far away. The code runs where the response is delivered, which keeps the distance short. For many business sites, it is the missing piece that lets a static site do a little more.

What is edge computing?

These servers are part of a CDN, and the approach removes the need for a full application server for small tasks, as the code does not run on one central origin server.

A CDNA CDN is a network of servers around the world that keeps copies of your website close to your visitors, so pages load fast wherever they are. already holds copies of your files in many locations. Edge computing adds the ability to run code at those same locations. When a request arrives, a small function can look at it and decide what to do: serve a file, send a redirect, add a headerAn HTTP header is a short line of extra information that a browser and a website send each other with every page request, invisible to the visitor. or call an outside service.

The functions are small and quick by design. They are not a place for a large application with a heavy database. They suit short jobs that need to happen on each request or on certain requests, and they run without you managing a server.

What edge computing means for your PHP site

On a PHPPHP is a programming language that builds your web pages on the computer that hosts your site, just before they reach the visitor. WordPress runs on it. site, any decision per request goes through PHP on your server. That includes simple things like redirecting an old URL, blocking a path or checking a header. With edge code, those decisions can be made before the request reaches your server, or on a site with no server at all.

This is useful when you move a PHP site to a static websiteA static website is made of ready-made page files that the server hands over as they are, with no PHP code or database working behind the scenes.. Redirects from old addresses, a form handler or a bit of access logic can live in edge functions, so you do not need PHP behind the static files. The attack surfaceThe attack surface is the total of all places where an attacker could try to get in, such as logins, forms, plugins and the code on your server. stays small because there is little running code, though the functions you write can still contain mistakes and need review like any other code.

Edge code runs on a provider’s platform, so you depend on that provider’s rules, limits and pricing. Check what a function may do, how long it may run and what it costs at your expected traffic.

How to tell if you need it

List what your current PHP site does on the server beyond showing pages. Typical items are redirects, a contact form, a newsletter signup, language detection and protection of a private area. Each one is either something the static site can do on its own, something a small function can handle, or something that needs a real application.

If most items fit the first two groups, edge functions or other serverlessServerless is a way to run code without looking after your own server: the provider runs your small pieces of code when needed and keeps the machinery updated. functions are a good match. If the third group is large, keep an application and consider a mixed setup.

A concrete example

A contact form on a static site posts to an edge function. The function checks the submission, passes it to your mail service and returns a short confirmation. A spam check such as TurnstileTurnstile is Cloudflare's privacy-friendly check that tells real people from bots on your forms, without making visitors solve puzzles. can sit in front of it. No PHP and no database are involved, and nothing runs on a server you have to patchA security patch is a software update that closes one known security weakness and adds nothing else, so installing it protects you against that problem..

Our service to move from WordPress to a static site uses this kind of approach for the dynamic parts of a rebuilt site.

When to act

Look at edge computing when you plan to leave PHP and want to know what replaces the server-side bits, or when a CDN-based site needs small bits of logic. Keep the functions few and well described, so that the site stays easy to understand.

Frequently asked questions

What is an edge function?

An edge function is a small piece of code that runs on a CDN server close to the visitor, rather than on a central server. It can redirect a request, change a response or handle a form.

Is edge computing the same as serverless?

They overlap. Serverless means running code without managing a server. Edge computing describes where that code runs: near the visitor. Many edge functions are serverless, but not all serverless code runs at the edge.

Do I need edge computing for a normal business site?

Usually not. A static site on a CDN covers most needs. Edge code helps when a few things must be decided per request, such as redirects, simple access rules or form handling.

Can edge code replace my PHP application?

For small tasks, yes. For a full application with a database and many features, it is rarely a simple swap. It suits small, well-defined jobs.

Related pages

  1. Domain
  2. Check
  3. Result
  4. Report

Which PHP version does your site run?

Enter your domain. We read only what your site already sends in public: the headers and the top of the homepage. No scan, no login. We keep the domain and the result, never your IP address.