Ravindra BagaleCourses & study guides मराठी Track your progress

Chapter 12: Technology Stacks — LAMP, LEMP, MEAN, MERN

AWS Cloud

Common Mistakes I See Students Make

Friends, start with the actual response. Compare the browser entry, generated assets and API separately. Check the running process and private dependency when the useful operation still fails.

  • Assuming a start script is the intended deployment. Read what it actually runs and select the approved build or runtime.
  • Applying the browser fallback to API and asset requests. Check that a deep link, valid API, missing API and missing asset respond separately.
  • Publishing the wrong artifact or public base. Read the generated entry document and test its actual script URLs.
  • Removing earlier assets before existing clients can move. Verify current and supported earlier documents during the transition.
  • Exposing a private database to make a test pass. Check the actual app source, network path, transport and account rights.
  • Assuming a killed build always needs swap. Inspect the failing step and relevant resource limits, then use an appropriate build environment.

Start with the request that failed, even when the home page works

Mauli Dairy publishes a new version of its pickup desk under /desk/. The homepage opens. One rider sees a blank section with a script error. Another cannot look up the east collection point even though the frontend says the route worked. The operator sees that the server process is alive. All three observations are plausible and can refer to separate failures. This review shows how to prove whether the wrong response came from browser build delivery, frontend route matching, an older retained document or a failing data dependency.

Write a precise report using the original URL, method and expected user outcome. Then write the actual response status, Content-Type and a recognizable piece of safe response data. Content-Type identifies the format of the response, such as HTML, JavaScript or JSON. Keep generated filenames and release markers in your notes. A marker can be a unique word in a classroom response or a public build identifier. A single green 200 can hide a web page sent in place of a JSON object or a script requested at the wrong path.

The working scenario has three named routes to test. A visitor opens the desk directly at a deeper browser route. The initial HTML points to a generated script. After the interface loads, it requests the schedule API. These are separate HTTP exchanges even when the rider experiences one page. The public API can then depend on another process or database path. Compare the request actually sent by the browser with a deliberate direct test, and record the difference before changing settings.

Keep the issue in scope. A missing asset on the newly published desk does not call for editing the root domain’s default site, opening a private database to visitors, or rebooting a shared server. Use a separate control route to establish what still works. Then make a focused decision using the first observation that disagrees. The runnable fault matrix on this page uses reserved names and a temporary loopback frontend. It does not read your site’s configuration or use real customer data.

A browser fallback catches an API call and returns HTML

A client-side application can navigate to a route without requesting a separate HTML document for each click. When a rider opens a deep link directly, the web server can serve the starting HTML for the client router to interpret. A frontend fallback is a configured rule that supplies that starting document for the intended browser navigation paths. It is a useful feature of a deployment that expects browser-side routing. It can also become a misleading response when applied too broadly.

In the desk incident the browser expects a JSON object from /api/schedule. Nginx selects a broad location, sees no matching physical file, and returns index.html with status 200 because the API prefix was never sent to the backend. The network panel may look successful at first. Read the response’s Content-Type and first safe body marker. If the body is the desk shell and the application attempted JSON parsing, the mistake is visible before considering a database problem.

List three intended outcomes for this service. The recognized deep link returns HTML with the current browser entry point. The valid API route returns a useful JSON response. An unknown API route returns the API’s expected error status and type. Use separate route rules and controls so none of these relies on a generic success fallback. The server can route the API prefix to the actual private API listener and limit the fallback to the intended browser path. A missing static asset should also preserve a useful missing-file error.

Check the name and route selected by the frontend. Another public host or a default virtual host can return its own HTML even if your exact API rule is correct in the intended site configuration. Compare the normal public result to a scoped request using the correct host at the candidate addresses when approved. For an HTTPS candidate test keep the original name and TLS verification. Record if the test used an address override because that observation bypasses ordinary DNS. A default welcome page and the app shell can both be HTML while coming from different places.

Sometimes the API is running and the forwarded request reaches its application with an unexpected prefix. An Nginx proxy_pass value that has a URI can replace the normalized matching location’s prefix under the documented rules. Without a URI in the ordinary case, it can forward the original path. Read the actual configuration and what the application request log received. A genuine JSON 404 from the expected app is different from an HTML shell accidentally returned by Nginx. Test a supported route and the deliberate missing route after choosing the path contract.

The deployed page references assets outside its public base

Suppose the version-two HTML file arrives and the browser asks for /assets/app-b.js. In the intended public layout the working file URL is /desk/assets/app-b.js. The leading slash tells the browser to use the host’s root. The file can exist in the correct directory with correct permissions and still be absent at the URL the browser requested. The useful evidence is the reference in the delivered HTML and the exact asset request. A local filesystem listing is only one part.

Distinguish several settings that are easy to conflate. The public base determines generated asset URLs. A client routing base tells the app how to interpret the public path. The frontend’s file mapping identifies where the built files are stored. The API base determines where the browser sends data requests. These can need compatible values without being the same setting. A route prefix appropriate for browser navigation does not automatically rewrite API calls or make a hidden file public. Read the project’s current build and router documentation.

For a Vite browser build, the configured public base is one way to shape generated asset references for a nested deployment. Angular has options controlling the browser base and build layout, and its appropriate settings depend on the builder and rendering mode. Inspect the actual generated index.html and output directory for the project you built. Verify the deployment points at the correct browser output and runtime where applicable. Do not assume every tool writes an identically named directory or that all apps are static.

Test both a direct deep link and a navigation from the initial route. While an app is already running, a link can use in-memory routing and appear fine. A fresh visit to the deeper URL needs the frontend to return the right entry and every required script. Use a clean context, record exact asset URLs, and verify their response types. A script URL answering with HTML can produce a parsing or type error even though the transfer itself returned 200. Treat that error as a clue to check the file mapping and fallback.

Keep build artifacts and private inputs separate. The published browser output needs its generated files and approved public settings. It should not include the private source checkout, deployment credentials or database files. Frontend build tools can embed client-exposed variables in generated code. A variable known to a browser is not a secret. Keep privileged database access in the controlled backend. Rebuilding with a different public API URL can be appropriate when the setting is intentionally built into the artifact. Editing a server-side process variable after publishing a static bundle will not necessarily change the code the browser already downloaded.

Old HTML can still refer to an earlier generated filename

Assume the new release really contains app-b.js in the correct public directory. A returning rider’s earlier HTML still references app-a.js. If the release removed the old file immediately, the user can get a missing asset even while a new browser succeeds. Compare the actual HTML delivered to each client and which filename each requests. A checked current file does not prove the earlier response that the affected client already holds.

Generated assets often use versioned or content-fingerprinted names. A fingerprint identifies particular bytes so a release can publish a new URL when file contents change. An HTML entry document often changes more often and can use different cache rules from an immutable asset. The correct policy depends on the actual cache and deployment requirements. At an edge service, inspect the cache behavior and its TTL settings along with origin headers before claiming users always receive fresh HTML.

In standard HTTP caching, no-cache can allow storage while requiring validation before reuse. It is different from the no-store directive. Revalidation means that a cache checks whether its stored response can still be used. Compare cache policy, validators such as ETag or Last-Modified when present, and the actual document returned. An existing browser tab can still use previously loaded assets or a cached shell for other reasons. A service worker, if the application uses one, can supply its own configured offline or update behavior. Label which layer you are evaluating.

Plan a compatible release transition. Publish complete new assets before directing new documents at them. Retain required versioned older assets for the intended transition and rollback window. Keep a known compatible API for browsers that may still use the earlier interface. Verify new and previously loaded clients, especially when routes or body fields change. Cleaning out the directory immediately after a copy can remove a chunk still referenced by a cached document. Rolling back only the HTML can also fail if its script set has already been removed.

Ask for two comparisons during an incident. Under normal routing, which entry document and generated script did the affected client receive or reuse? Through an approved candidate or origin check, which versions are available now? If the current release’s entry references the correct accessible asset and the older document consistently references an absent one, focus on the transition plan. If even fresh HTML references a nonexistent path, inspect the built artifact and scope first. Avoid instructing every rider to clear cache while the root problem remains at the public entry.

A process can be alive while the private data route is unavailable

In a service manager, online can mean there is a process under the manager’s control. A liveness route can indicate that the process responds. Readiness is a deliberate answer about whether this target can take the relevant traffic. A customer operation tells you whether the system produced the expected useful result. These checks can have different purposes and different thresholds. Define which layer owns each result.

In the exercise the private API remains alive while its synthetic data dependency is marked unavailable. The liveness endpoint responds successfully, the readiness and lookup respond with 503, and the frontend still serves the initial HTML. An expected transient failure may be represented with a controlled status and a safe public message. After the private listener itself stops, the frontend produces 502 in this particular configuration. This is a different observed error from the API’s earlier JSON 503.

Do not memorize status 502 as a universal diagnosis. One gateway can create it when a private process refuses a connection, while another system can use it for a different problem or forward a response it received. Inspect the frontend’s upstream route and the matched request in scoped logs. Compare the same route at the actual app endpoint from an authorized internal path. If the app response is healthy there, ask whether the frontend can access the same socket, host or port and whether it passes the intended path and method.

When the API reaches its database but a useful operation fails, compare the actual connection endpoint, authentication, transport, schema or document expectations, and data access rights. A successful database login using a different administrator account is weak evidence for the intended app identity. A running listener can accept traffic and still return an authorization or data error. Keep the database private and test with the permissions the service is meant to have. Do not open it publicly simply to make a workstation diagnostic easier.

For MongoDB, bind it to the intended permitted address or socket, enable the applicable authentication and authorization setup, choose the required transport security and constrain network access. Manage a known compatible and supported release from its approved distribution. For any database, backup and restore have their own responsibilities. Restricting unauthorized access reduces some risks. Restorable backups enable recovery from data loss. One control does not replace the other.

Choose readiness behavior that reflects its real role. A heavy check that queries every dependency every second can create load or push all targets out of service when one shared resource fails. A constant ready response can instead hide a required dependency. Decide which operations should still be available during the failure. Keep a lightweight process check and a representative useful operation as independent evidence. Test timeouts and recovery safely in the planned environment rather than exposing private diagnostics.

Distinguish a build mistake from a runtime mistake

The command npm start runs the start behavior defined by the project or supported defaults. In one app it can start a development watcher. In another it may run a legitimate production server. Inspect the package scripts and the current deployment model before treating the command name as evidence. Angular’s development server is meant for development. A static browser release usually has a separate build and hosting path. A server-rendered frontend can still require an actual production runtime after the build.

Record the approved runtime versions and lockfiles. Build into a candidate workspace rather than relying on whatever packages a production login shell happens to see. For a static deployment choose only the reviewed browser artifact. If server rendering is part of the design, include its server output and compatible runtime dependencies as appropriate. Preserve the prior release and select the exact version to route to. A version marker can belong to the entry document, dynamic app or data. Decide which one you are observing.

If a build process is killed, inspect why. Memory pressure, configured process limits, native package errors and simple compilation failures require different fixes. Reducing parallelism or using a suitably sized build environment can help when measured memory is the issue. Swap is an operating-system resource decision, not a universal cure for a failed application build. Consider build and serving capacity separately. A server that can efficiently deliver static files may not be the intended environment for building them.

Keep a clear startup owner for anything that runs after deploy. Node can run behind a process manager or managed platform. PHP-FPM has its own workers under the chosen deployment process. A browser bundle is not a server-side process on its own. Verify the actual scripts, account, runtime version, private ports and date of each launch. If a managed app fails to return after an approved host restart, inspect its startup integration and saved or configured version. Do not use a live reboot as the first acceptance check on a shared server.

Run a private fault matrix with the same URL for both behaviors

Use a regular Unix-like account with Python 3 and Nginx. Make Nginx available on your path or set NGINX_BIN to its full executable path. The exact block was checked with Nginx 1.30.7. It uses a fresh temporary directory, one private Nginx process and a small built-in Python HTTP API, all on loopback. The two reserved hostnames select a deliberately broken frontend and a corrected one. No framework build, package installation, real database, external DNS, public connection or operating-system service change is required.

Before running it, practice the comparison. The broken frontend will answer a JSON path with HTML 200. Its entry requests a script outside the correct base. The working frontend can return a valid browser shell and correct asset. Then a saved earlier HTML document points to a deliberately removed file. After the data dependency state changes, liveness remains 200 while readiness and lookup return 503. Finally the API socket closes and Nginx instead answers the request with a gateway 502. Predict the status and response format, not just the printed label.

python3 - <<'PY'
from http.client import HTTPConnection
from http.server import BaseHTTPRequestHandler, ThreadingHTTPServer
from html.parser import HTMLParser
import json
import os
from pathlib import Path
import shutil
import signal
import socket
import subprocess
from tempfile import TemporaryDirectory
from threading import Thread
import time

nginx = os.environ.get("NGINX_BIN") or shutil.which("nginx")
if not nginx or os.geteuid() == 0:
    raise SystemExit("Run as a regular user with nginx in PATH or set NGINX_BIN.")

class ScriptPath(HTMLParser):
    def __init__(self):
        super().__init__()
        self.source = None

    def handle_starttag(self, tag, attrs):
        if tag == "script":
            self.source = dict(attrs).get("src")

def asset(html):
    parser = ScriptPath()
    parser.feed(html.decode())
    assert parser.source
    return parser.source

class Schedule(BaseHTTPRequestHandler):
    def do_GET(self):
        if self.path == "/api/live":
            status, payload = 200, {"running": True}
        elif self.path in ("/api/ready", "/api/schedule"):
            if state["data_ready"]:
                payload = {"ready": True} if self.path.endswith("ready") else {"pickup": "EAST-1600"}
                status = 200
            else:
                status, payload = 503, {"error": "schedule data unavailable"}
        else:
            status, payload = 404, {"error": "unknown API route"}
        data = json.dumps(payload).encode()
        self.send_response(status)
        self.send_header("Content-Type", "application/json")
        self.send_header("Content-Length", str(len(data)))
        self.end_headers()
        self.wfile.write(data)

    def log_message(self, *args):
        pass

def request(host, route):
    connection = HTTPConnection("127.0.0.1", front_port, timeout=2)
    try:
        connection.request("GET", route, headers={"Host": host})
        response = connection.getresponse()
        return response.status, response.getheaders(), response.read()
    finally:
        connection.close()

def media(reply):
    return dict(reply[1]).get("Content-Type", "").split(";", 1)[0]

def page(script):
    return '<!doctype html><h1>Pickup desk</h1><script src="' + script + '"></script>'

def stop(process):
    if process.poll() is None:
        process.send_signal(signal.SIGQUIT)
        try:
            process.wait(timeout=4)
        except subprocess.TimeoutExpired:
            os.killpg(process.pid, signal.SIGKILL)
            process.wait(timeout=4)

good = "ready.example.test"
bad = "broken.example.test"
entry = "/desk/pickup/east"
state = {"data_ready": True}

with TemporaryDirectory(prefix="stack-mistakes-", dir="/tmp") as folder:
    lab = Path(folder)
    browser = lab / "desk"
    files = browser / "assets"
    files.mkdir(parents=True)
    good_page = browser / "index.html"
    old_file = files / "app-a.js"
    old_file.write_text('console.log("release-a");')
    (files / "app-b.js").write_text('console.log("release-b");')
    good_page.write_text(page("/desk/assets/app-a.js"))
    (browser / "wrong.html").write_text(page("/assets/app-b.js"))

    with ThreadingHTTPServer(("127.0.0.1", 0), Schedule) as api:
        worker = Thread(target=api.serve_forever, daemon=True)
        worker.start()
        process = None
        try:
            with socket.socket() as available:
                available.bind(("127.0.0.1", 0))
                front_port = available.getsockname()[1]
            config = lab / "nginx.conf"
            config.write_text(f"""
worker_processes 1;
pid "{lab}/nginx.pid";
error_log "{lab}/error.log";
events {{ worker_connections 32; }}
http {{
    access_log "{lab}/access.log";
    types {{ text/html html; application/javascript js; }}
    default_type text/plain;
    client_body_temp_path "{lab}/client";
    proxy_temp_path "{lab}/proxy";
    fastcgi_temp_path "{lab}/fastcgi";
    uwsgi_temp_path "{lab}/uwsgi";
    scgi_temp_path "{lab}/scgi";
    server {{
        listen 127.0.0.1:{front_port};
        server_name {bad};
        root "{lab}";
        location / {{ try_files $uri /desk/wrong.html; }}
    }}
    server {{
        listen 127.0.0.1:{front_port};
        server_name {good};
        root "{lab}";
        location ^~ /api/ {{
            proxy_pass http://127.0.0.1:{api.server_address[1]};
        }}
        location = /desk/index.html {{ add_header Cache-Control "no-cache"; }}
        location ^~ /desk/assets/ {{
            try_files $uri =404;
            add_header Cache-Control "public, max-age=31536000, immutable";
        }}
        location /desk/ {{ try_files $uri $uri/ /desk/index.html; }}
        location / {{ return 404; }}
    }}
}}
""")
            args = [nginx, "-p", folder + "/", "-c", str(config),
                    "-e", str(lab / "bootstrap.log")]
            subprocess.run([*args, "-t"], check=True, timeout=8)
            with (lab / "boot.log").open("w") as log:
                process = subprocess.Popen(
                    [*args, "-g", "daemon off;"], cwd=lab, stdout=log,
                    stderr=subprocess.STDOUT, start_new_session=True,
                )
                until = time.monotonic() + 8
                while time.monotonic() < until and process.poll() is None:
                    try:
                        old_html = request(good, entry)
                        break
                    except OSError:
                        time.sleep(0.05)
                else:
                    raise RuntimeError((lab / "boot.log").read_text() or "Frontend did not start")

                mistaken_api = request(bad, "/api/schedule")
                good_api = request(good, "/api/schedule")
                assert (mistaken_api[0], media(mistaken_api)) == (200, "text/html")
                assert (good_api[0], media(good_api)) == (200, "application/json")
                print("Fault 1: broad fallback answered an API call with HTML 200.")

                bad_asset = asset(request(bad, entry)[2])
                assert bad_asset == "/assets/app-b.js"
                assert media(request(bad, bad_asset)) == "text/html"
                assert request(good, bad_asset)[0] == 404
                print("Fault 2: wrong base omitted /desk/; broad fallback hid it.")

                old_asset = asset(old_html[2])
                assert dict(old_html[1])["Cache-Control"] == "no-cache"
                assert request(good, old_asset)[0] == 200
                good_page.write_text(page("/desk/assets/app-b.js"))
                current = request(good, asset(request(good, entry)[2]))
                assert (current[0], media(current)) == (200, "application/javascript")
                assert "immutable" in dict(current[1])["Cache-Control"]
                old_file.unlink()
                assert request(good, old_asset)[0] == 404
                print("Fault 3: saved old HTML requested a removed file; current build passed.")

                state["data_ready"] = False
                assert request(good, "/api/live")[0] == 200
                assert request(good, "/api/ready")[0] == 503
                failed = request(good, "/api/schedule")
                assert (failed[0], media(failed)) == (503, "application/json")
                assert request(good, entry)[0] == 200
                print("Fault 4: process up and shell served, dependency not ready.")

                api.shutdown()
                worker.join(timeout=5)
                api.server_close()
                assert request(good, "/api/schedule")[0] == 502
                print("Control: no upstream listener produced 502 instead of application 503.")
        finally:
            if process is not None:
                stop(process)
            if worker.is_alive():
                api.shutdown()
                worker.join(timeout=5)

assert not worker.is_alive() and process.poll() is not None and not lab.exists()
print("Private frontend, API and temporary files removed.")
PY

The first two cases begin with a real fallback rule that gives the same wrong HTML to the API and to a wrongly referenced script. The corrected virtual host reserves the API prefix and distinguishes browser navigation from required asset paths. The successful API check tests both status and media type. A similar check on the independently requested script distinguishes an actual JavaScript asset from an HTML response. Copy those two observations into the matrix as separate results.

The next phase keeps the earlier shell response in the Python test process as a saved example, changes the current served shell, and explicitly requests the old URL after removing the old file. This demonstrates the consequence of an earlier entry referring to missing bytes. It is not a browser cache implementation. The experiment verifies actual shell and asset Cache-Control headers, but it never asserts that a particular browser or CDN will keep the same file for that lifetime. Time-to-live behavior depends on the real app and environment you later test.

Then the local API gets a simulated unavailable data state while its listener continues handling requests. Do not treat that as a real database outage. It purposefully creates an application response you can compare with Nginx’s later gateway error when the backend closes. The type and status change once the frontend can no longer use the upstream endpoint. This is why stopping a running service just because its lookup fails can remove a valuable distinction. Choose a next check based on the actual first failure.

If Nginx cannot bind its allocated local port, run again so the fixture can select a different free port. If the candidate configuration fails, read its stated syntax message and confirm the executable includes the relevant basic HTTP modules. The program only stops the child it starts and closes the API thread. The temporary directory is then removed. Preserve the printed observations and do not adapt a deliberately broken configuration for an actual public site.

Use the fault matrix to choose the next check

Observations for one published pickup desk
SymptomFirst comparison to makeUseful acceptance result
API fetch gets HTML 200Inspect actual host, route, response type and body marker against the direct API result.Data route returns intended JSON. A separate unknown API gives its specified error.
Browser requests asset outside the approved baseCompare emitted script reference, requested URL and deployed output directory.Fresh entry and deeper navigation can fetch all expected assets with legitimate media types.
Earlier entry requests a removed scriptIdentify the client’s document version and check both its asset URL and the current shell’s reference.Required previous and current releases work throughout the planned transition.
Live endpoint succeeds and ready route gives 503Observe the intended private dependency with the actual app identity and limited credentials.The app returns the approved current schedule through the ordinary path once the dependency recovers.
Public proxy cannot reach the appCompare the configured upstream with the actual private listener and allowed access.The public route reaches the expected runtime and returns its correct response.

Use the table to make a specific incident note. Start with the link from the rider’s report. Write the expected behavior and observed status, media type and body marker. Close the incident only after a real operation recovers through an appropriate test path. If read-only evidence is incomplete, record which names or network paths are still unobserved. A diagnostic that changes several inputs can prove a candidate works while leaving the actual customer path untested.

Make one distinction for Laravel or WordPress on a PHP stack. A front controller is a common app entry that receives several public routes. The frontend may intentionally direct a path to a PHP script when that path is not an existing static file. Compare the direct route, actual FastCGI mapping and script output. Avoid applying a browser SPA fallback to a PHP application merely because both frameworks use names for URLs that do not correspond to files. Conversely, a web server returning the entry HTML file does not prove that the PHP worker or app API ran.

When logs are needed, collect them at the exact time for the relevant scope. A shared frontend can record the named request and whether the chosen upstream returned a status. The API can log its selected route and safe error category. The process manager can show whether the actual runtime initialized and bound its appropriate interface. The storage owner can verify the relevant access or data state. Clean evidence helps people agree on the next check without sharing credentials, complete user requests or logs from another site.

Release and roll back a whole artifact set coherently

A browser release is a set of related files. The entry page, build assets, runtime settings and deploy configuration must be compatible. The API may be a separate versioned artifact, with an evaluated compatibility relationship to the client. Record which files can be reused across versions and how to identify them. Retain a known prior compatible artifact and public route while uncertain dependencies are verified. A release operation should not destroy the only file set that the previous HTML needs.

Before rollout prove the current entry and its referenced files. Upload a complete candidate under a separate release area and test its exact public prefix. Confirm the expected content and route, then record a first-hop request and the dynamic operation that follows. If an authorized address override or staging hostname is used, repeat ordinary public acceptance once routing is approved. Use realistic read-only requests whenever possible. A test that requires an existing live order should be coordinated with its owner rather than replaying customer data during deployment.

Put two browsers in the paper plan. One already opened version A and may request a lazily downloaded part later. The other arrives after B becomes visible. A new deployment that deletes an earlier file may work for B and fail for A. Retain the required prior assets and preserve the compatibility window with the API. If a response has hard guarantees about freshness, verify intervention and retirement with application and cache owners. The duration should come from the requirements and observed deployment policies.

State the smallest return conditions. If the new entry links to a missing generated path, repair the correct artifact placement or select the verified previous release with its required files. If the new API returns a well-formed body with wrong content, use the compatible previous endpoint or app release and verify relevant data. If the new frontend breaks an unrelated default site, stop and restore the approved scoped config. A source checkout alone cannot recover previously removed assets, reverse an incompatible data change or prove its workers are receiving traffic.

Choose a safe retention boundary. Keep relevant recovery material for the planned interval, then remove only artifacts that belong to the superseded release after the approved checks. Record the original and replacement commit or build identifiers and expected output. This gives the next operator enough information to diagnose whether a user saw A, B or another unaffected site. Keep one known control outside the updated route if those sites share a listener.

Practice the comparisons with one altered observation

Pick the wrong-base case first. Your partner supplies a fresh HTML document which references the correct path, but a request for the script still answers with a generic page. Identify why the earlier diagnosis has changed. The generated path may be correct this time. Look instead at the active root, file mapping and rule that serves the exact script. Verify whether the request reached the expected host. A name, base and fallback comparison works only if it uses the actual response.

Now pick the stale case. The earlier client asks for its old file, which the origin still has. The browser receives a missing-file response through an edge. Capture the hostname, exact path and response evidence from the affected edge and approved origin access. A stored older error or bad routing rule can survive a change to origin files. Inspect the actual cache behavior before clearing unrelated files. Test through both paths and report scope when you can observe only one.

Next simulate the running API with missing data. Change the worksheet so readiness returns 200 but the known customer operation returns 503. Ask what the readiness check really covers and whether it should cover the failed dependency in that architecture. Test the required route and data result at the same time so an outdated readiness probe does not become the acceptance criterion. Document what will happen to ordinary requests during a dependency failure.

Finish with a small handoff. State one expected real browser URL, one static reference and one data request. Include the exact result that would signal a missing asset or application failure. Assign owners for the route config, build artifacts and data. Keep test data harmless. Remove only the temporary processes and files your exercise created. An operator reading the evidence should know where the first mismatch was and how to observe recovery without changing an unrelated server.

Keep separate records for the browser, edge and origin

Imagine the report says the desk briefly worked after an operator forced a browser reload. A student concludes the server is healthy and says every rider should repeat the reload. Before calling it solved, compare the fresh browser’s actual entry response and asset request with the affected browser’s previous entry and expected requests. A browser can reuse a response or hold a prior document in a running tab. An edge cache can separately return a response from earlier. The origin can know only which request it actually received. These are different places to collect evidence.

For a first pass, ask what is safe to observe in the browser’s network view. Use the exact harmless URL and note the response media type, status and a release marker. Some browser tools label that a response came from local caching. Compare the actual generated asset URL before looking at a named file on an origin disk. Capture what informs the diagnosis and leave personal or signed values out of the note. A browser trace can be made smaller by describing just the sequence of public paths and statuses involved.

For a public edge, compare the expected route and returned version with an authorized origin test preserving its intended address and host. Make a note when the origin accepts a different direct route that visitors never use. If the edge has its own cache policy, check which behavior applies to the requested HTML, static asset and API paths. A fresh result at the origin does not prove that a recently cached response elsewhere has been updated. If a private connection succeeds but the public API returns HTML, compare routing before relying on any cache diagnosis.

After a scoped correction, verify the real visitor sequence twice if you have both contexts available. Open the direct deep link in a fresh context, confirm the entry and assets, and make the meaningful pickup lookup. In a second context preserve an earlier open tab or a known older entry and test the required compatibility behavior. If the older entry no longer belongs to the supported transition, verify that the application handles that state as the product requires. The goal is to understand the observed paths, not to force every client state to behave identically.

Think about a case where status 304 appears in the report. It can be a validation response confirming that a stored representation is still suitable under the applicable cache rules. You need the stored representation or its identifier to tell which actual content the browser will use. A 304 is a different observation from a freshly returned 200 body. Match the response, validators and resulting entry and assets to the expected version before assigning blame to the current API.

Close the work with a concrete result. The desk’s published deep link serves HTML naming available JavaScript. The script reaches the correct API route and receives a meaningful schedule. An intentionally unsupported API path returns its approved error. The affected earlier context either continues working through the supported interval or follows the planned recovery. A second known site still returns its expected result. Each observation should have a named path and owner so the next person can rerun it directly.

Explain which evidence would change your mind

Why can an API appear in the network panel with status 200 and still be broken?

A fallback can answer a missing API path with the browser app’s HTML. Inspect the exact host, path, content type and body, then compare with the intended private API. The status alone does not establish that the request reached the JSON route.

A script exists on the server but never loads in the browser. Which three locations do you compare?

Compare the generated reference in the actual delivered HTML, the URL the browser requests, and the public file mapping to the built artifact. If the response returns the shell, also check whether the frontend gave a fallback answer to an asset request.

Why might a returning visitor fail while a fresh visitor sees the current release?

The older document can refer to earlier immutable asset URLs. Compare the two entry versions and their dependencies. Plan to keep the old assets and compatible API behavior for the relevant transition window.

How do you distinguish a readiness failure from a missing upstream?

A running API can explicitly return a controlled 503 while waiting for data. A gateway can return its own 502 if the listener is not reachable. I would verify the private app response and relevant frontend logs for the exact route before deciding what failed.

Would you use a service manager’s online label as your release check?

I would use it as process evidence. Verify the actual runtime and representative request through the intended frontend. If data availability is part of success, check the meaningful operation and data response separately.

Choose a next check for each symptom

  1. The JSON client sees text/html and an entry-page marker. Where should the next test start?

    Answer and reasoning

    At the frontend’s named route selection and fallback. The response did not meet the API’s media type. Compare the private route with the public one.

  2. Current HTML references the correct versioned script. An older document names an absent earlier script. Can both observations be true?

    Answer and reasoning

    Yes. The client can reuse an older document or still have an old tab open. Check transition compatibility and retain required earlier assets through the relevant period.

  3. Does Cache-Control no-cache automatically prevent a response being stored?

    Answer and reasoning

    No. It can allow storage but requires validation before reuse under the standard rules. Verify real client and edge behavior for the actual policies in use.

  4. The shell loads and /api/live succeeds. The lookup returns a controlled 503. Which observation is closest to the business need?

    Answer and reasoning

    The actual lookup exposes the unavailable schedule. Follow the app’s intended private data path and verify recovery again with the normal user route.

  5. A deployment uses a build artifact, and a public configuration value appears in the delivered JavaScript. Does hiding the value in a build variable make it private?

    Answer and reasoning

    No. A value embedded into delivered files is accessible to the browser. Private database or signing credentials belong in the controlled server runtime.

Cards for the next deployment issue

Response type matters

Keep the status, Content-Type and safe marker. A successful HTML response can be wrong for both script and API requests.

Inspect the generated reference

Compare the built entry, actual request URL and correct public file placement. Test direct deeper paths.

Deploy compatible assets together

Publish matching files and retain needed earlier assets through the transition. Treat browser, edge and origin evidence distinctly.

Live, ready and useful

Process state, readiness and end-user operations each answer their own question. Follow the actual path to the first mismatch.

Keep storage private

Use intended addresses, authenticated app identities and allowed routes for data. Recover from a verified backup and test a real operation.

Official references