Backend Development 14 min read

Design and Implementation of JD's Unified Header/Footer Management System

The article describes the design background, overall architecture, management backend, and header/footer client implementations (Nginx and Java) of JD's unified header/footer management system, explaining how it enables rapid, centralized updates of site-wide header and footer content across hundreds of services.

JD Tech
JD Tech
JD Tech
Design and Implementation of JD's Unified Header/Footer Management System

JD's Unified Header/Footer Management System addresses the difficulty of updating copy and images across hundreds of web applications by providing a centralized solution that allows developers to switch site-wide header and footer content with a single click, dramatically improving development efficiency and reducing maintenance costs.

System Background – Updating a single website's copy may take minutes, but modifying hundreds of sites requires product requests, development scheduling, and regression testing, turning a simple change into a product manager's nightmare. JD's massive e‑commerce platform uses a common header and footer across many subsystems, necessitating a unified management approach.

Overall Architecture – The system consists of two main parts: a management backend for maintaining header/footer files and configuring their association with business systems, and a client side (Java or Nginx) that fetches, parses, and renders these files. MCube determines whether to fetch the latest template, loads it into a view‑tree, resolves expressions and events, and finally renders the page.

Management Backend Design – Implemented as a front‑end/back‑end separated application, the backend provides three modules: file management (CRUD, version control, publishing, rollback of header/footer HTML), application management (registering business systems, configuring relationships, viewing request logs), and personal center (operation logs and approval workflow). HTTP APIs are exposed by the back end, while the front end handles rendering.

Header/Footer Client Design

Two client implementations are offered:

Nginx Client – Uses the <!--# include file="/fragment/footer.html" --> SSI directive. Because the included file must exist on the server, URL rewriting and reverse‑proxy configuration are used to fetch the file from the header/footer service. Local caching ( proxy_cache ) reduces request pressure and improves resilience.

Java Client – A dedicated Java library that downloads header/footer files to a local directory, monitors updates via a background thread, parses SSI include directives, and renders pages without runtime SSI processing, achieving near‑zero performance impact for business systems.

Both clients support multiple programming languages (Java, JS, PHP, Go, Lua) via the push or pull distribution models, with the pull model ultimately chosen for its simplicity and reliability.

Conclusion – The unified system provides a fast, reliable way to manage site‑wide header and footer content, offering detailed design choices, implementation details, and trade‑offs to help engineers select the most suitable solution for their environments.

BackendJavaNginxssifooterheader
JD Tech
Written by

JD Tech

Official JD technology sharing platform. All the cutting‑edge JD tech, innovative insights, and open‑source solutions you’re looking for, all in one place.

0 followers
Reader feedback

How this landed with the community

login Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.