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

Chapter 7: Static Website Hosting (3 OSes × 2 Web Servers)

AWS Cloud

7.1 Why and what

Friends, in this chapter you can preview your own web page over HTTP and, in an approved public sandbox, test the intended deployed path. Seeing the page respond is a special moment in class. Let's first understand what a static website is. Mauli Dairy's daily rates and contact page are exactly such simple files.

A static website can serve prepared resources such as HTML, CSS, JavaScript, images and fonts without generating their business content for each request. An origin may apply response handling such as compression or caching. A site can also use a separate API or build-time data source. Examples: portfolio/resume sites, college fest pages, documentation, landing pages and the built output of React/Angular/Vue apps.

Why host it on EC2? It lets you practice server configuration, file permissions and HTTP troubleshooting. A suitable S3 and CloudFront setup can provide another static hosting option with different responsibilities.

How it works: In the simple authorized direct HTTP example, a permitted client reaches the configured listener. Nginx or Apache selects a site and maps the URL path under its document root when that site uses ordinary file mapping. A directory request can use an index file.

 URL:   http://192.0.2.25/css/style.css
 root:  /var/www/mysite
 file:  /var/www/mysite/css/style.css     (root + URL path)

Ravindra Bagale's Tip

A React, Angular or Vue project can produce static build files for Nginx or another host, depending on how it is configured. If it needs request-time rendering, that part must have its intended runtime. Browser JavaScript can also call a separate API. Check how each route and resource is actually produced.

Lab

Chala, kagdavar Mauli Dairy chya website che teen URLs liha (/, /css/style.css, /rates.html) aani document root /var/www/mysite gheun pratyek URL sathi identify the file selected by the simple root mapping. For the directory request /, assume the site is configured to use index.html.

Publish a page whose content is known before anyone asks for it

Mauli Dairy wants customers to read today's milk rates, the shop address and holiday opening hours. At the beginning of the day an employee prepares and checks one rates page. Once it is published, anyone allowed to view the page should see the same approved rates for that version. The server does not need to look up each visitor's account or recalculate the rates for each request. It can respond using the prepared files. This is a useful first static website because you can follow a single request all the way from a named path to the content that answers it.

Static describes how the content for the request is prepared and served. The website can still change. Mauli can publish a new file when the prices change. A navigation menu can expand when a reader clicks it. An image can move with CSS, and JavaScript can calculate what the selected quantities add up to in a visitor's browser. Those actions happen on the client. A site may serve static HTML, styles and scripts and separately call a dynamic API that looks up private order status. Think about the specific request you are tracing, instead of assigning one label to every system a site uses.

The files you publish can be plain HTML written by hand, or output produced before deployment by a documentation, template or front-end build tool. A build step runs when you prepare the site files. A request-time server operation runs when the user asks for a page or data. A machine that serves a finished file does not need the full source tree or the toolchain that generated it. If the application needs a separate server to render or retrieve a response per request, verify that runtime separately.

This lesson uses a synthetic rate sheet and documentation-only addresses and names. It starts with files in a disposable local directory and a loopback HTTP preview. None of the exercises on this page require opening a public port or changing an existing website. Later lessons apply the same content and response checks to an approved Nginx or Apache server. The skill is seeing which file and configuration produced what the browser displays.

Identify the job of HTML, CSS, images and browser scripts

HTML describes the structure and meaning of the page. For the dairy's public information it might contain the page title, a heading, the updated date, a table of example rates and a link to contact information. A stylesheet controls presentation such as readable spacing and colors, and adapts the layout for small screens. Images illustrate where the shop is or what a product looks like. Optional browser JavaScript can add local behavior, for example filtering a prepared list of products. The browser usually requests these as separate resources.

When you open a web page, the initial HTML can be the first thing the server sends. The browser parses it and learns that it needs other URLs. It requests the stylesheet, image or script named in the HTML according to page and browser rules. A visible heading establishes that some HTML arrived and rendered. It does not establish that the CSS or image URL loaded. A page can be mostly readable with an error in one asset. Inspect both the expected appearance and the independent request results.

For a local filtering example, suppose a table with 12 products is already present in the page. The browser can hide rows not matching a filter without asking the server to recompute the table. In a more complex example a search box sends a request to a service for the current inventory. That service may query a database or apply permissions for the signed-in user. The page assets can still be served statically, while the search call uses a different endpoint and runtime. The debugging questions become “Did the HTML and script load?” and “Did the permitted data request return what this user should see?”

Static files are normally public to every authorized client that can request them through that web server. Do not place passwords, private notes or backend keys in HTML, CSS, images or downloads. A client can inspect what it receives even when the page's design does not display it. An undrawn button or browser-side filter is not an access-control system. Keep internal source, data and credentials out of the publication directory unless the exact deployment has a verified access and confidentiality design for them.

Translate a URL into a file after selecting the proper site

A URL has a scheme such as HTTP or HTTPS, a hostname, an optional port and a path. In http://training.example.com/rates.html, the browser knows it should use HTTP and request the path /rates.html from the hostname. The hostname can help select the intended configuration when several sites share a listener. The path helps the server decide what representation to return using its configuration. The server's filesystem path is internal. A browser does not need to know whether the server uses /var/www/mysite or another approved root.

Document root means the directory a site's simple file mapping uses for its public content. In a basic configuration, if the root is /var/www/training-dairy, the server can look for /var/www/training-dairy/assets/site.css when the requested path is /assets/site.css. A directory request has additional behavior. If a request names / or /rates/, the server can use a configured index file such as index.html. It may redirect a request to a slash-terminated path in some configurations. Look up the actual server settings before assuming every platform adds an index name.

Requested pathLikely file in this simple exampleRelated setting
/training-dairy/index.htmlThe root directory's configured index document.
/rates/training-dairy/rates/index.htmlThe requested directory and configured index document.
/assets/site.csstraining-dairy/assets/site.cssThe site root and exact path spelled by the browser.
/missing.htmlNo corresponding file in this release.Normal missing-resource behavior, possibly with a custom 404 body.

This is a model for a minimal file site. Apache Alias or Nginx location and alias directives can change the mapping. A configured rewrite or proxy can send certain paths elsewhere. A dynamic route can produce content rather than opening one named file. Before changing permissions or adding a file, inspect which host and path rules actually apply. Accurate troubleshooting starts with “Which configuration chose the file?”

The example values above are relative descriptions for the table. They do not publish anything. If /rates/ returns a directory list instead of the intended page in a training preview, check whether the index file is present and which preview behavior is enabled. Configure production listing and default files intentionally. A directory list can reveal names you did not mean to publish and is not a substitute for an approved index.

Resolve asset links from the page address the browser actually used

Imagine the landing page links to a stylesheet at assets/site.css. A browser at https://training.example.com/ resolves that path to /assets/site.css. A browser at https://training.example.com/rates/ using the same relative text resolves it to /rates/assets/site.css. If the file exists only in the top-level assets directory, the second URL can return 404 while the rates page itself returns 200. The browser's request shows which base it used.

One way to refer from the nested directory to a sibling asset is ../assets/site.css in the demonstrated site structure. Another, when publishing at the site root, is a root-relative link like /assets/site.css. Know the intended deployment placement before choosing it. If an owner publishes the site under /course/dairy/ on a larger domain, a leading slash still points at the domain root. It won't include the prefix unless you include it intentionally or use another compatible linking model. A link can work on a temporary preview and then fail on a different base path.

Use a consistent naming convention and test it on the relevant filesystem. Linux web hosts commonly use case-sensitive paths. A working local preview on a case-insensitive filesystem can hide a mismatch between Site.css and site.css. Treat directory names, extensions and exact characters as part of the published interface. A link generated by a build process needs to match the actual built filename even if the source file has a different name.

Check the browser's Network panel for the full requested URL and response status. A page rendering without styles often means the CSS resource has a different requested path, wrong content type or cached version. Serve from a local HTTP origin during this test instead of opening a file directly from a desktop folder. A file: URL does not exercise HTTP status, path selection, content headers or a deployment's base URL in the same way as the intended hosting setup.

Read the HTTP status, body and content type as separate evidence

An HTTP response includes a status and headers, and often a body. A successful response for a requested stylesheet should include the intended CSS body and the usable content type such as text/css. A 200 alone cannot prove that the browser got the right asset. A misconfigured fallback can return the home HTML at a CSS URL with status 200. The browser may reject it as a stylesheet, or it can behave unexpectedly. Confirm content type and an identifying part of the body.

A 404 generally means the responding server did not find the requested resource or did not disclose that it exists. A custom page can explain what to do and still return status 404. Giving every missing file a successful status can make tests, search indexing and browser debugging misleading. A single-page application with browser-side routing can need a deliberate fallback for its supported navigation paths. Apply it according to the app's design. Ordinary images, styles and unrelated asset paths should still be verified as the expected resources.

A 403 can reflect an access decision, filesystem behavior or a directory with no permitted index or listing under the actual server configuration. Check the exact response and logs accessible under the approved environment. Do not set every directory writable just to see whether a site will appear. A web server normally needs read access to published files and traverse access to their containing directories. Upload and deployment privileges should be scoped to the actual role that writes the release.

Test one correct route, one expected asset and one intentionally missing teaching route. Record three status values, content types and identifying body text. If using a browser, distinguish the first document navigation from subsequent requests made for assets. If using a command-line client, issue the requests directly. Confirm that the URL under test uses the intended scheme and endpoint. This simple comparison gives you more information than saying a home page worked once.

Choose what this EC2 lesson teaches and what managed hosting can handle

EC2-based hosting gives you direct control over the guest operating system and web server configuration. This lets students inspect how Apache or Nginx listens, how a host name maps to a site root and what file permissions allow. It also requires the service owner to maintain the instance, package patches, authorized access, logging, certificates and any network exposure. A simple site on one portable directory still has those operating concerns when you decide to run the server yourself.

Managed static hosting and object/CDN designs can handle some of those infrastructure tasks differently. For example, an approved Amazon S3 and CloudFront design can serve selected static content through CloudFront. The S3 website endpoint and the S3 REST origin are different options. AWS documents that S3 website endpoints do not provide HTTPS directly, and CloudFront's origin access control uses the supported S3 bucket origin model rather than an S3 website endpoint. Choose configuration and access appropriate to the deployment. A private origin with controlled CloudFront access has different assumptions from publishing a public website endpoint.

Estimate the actual service requirements before choosing production hosting. Consider which users need access, whether HTTP redirects and routing rules are required, whether the service expects uploads or account-bound data, and how the team publishes revisions. Compare current rates, support, security boundaries and ongoing work. Object storage and CDN can be appropriate for a file-only workload. EC2 can fit when the course or app needs its own host and web server. Neither choice automatically supplies correct content, an access policy or a release process.

In the local lesson the first technical proof requires no cloud resource. Follow one request, interpret its response and confirm which version you served. When the owner eventually deploys to an approved EC2 workspace, use the same proof against the correct path. Use supported HTTPS and authentic DNS for a real public site, keep production content and keys out of classroom sandboxes, and make changes only within the approved site directory and configuration.

Give each release a known set of public files and a way to revert it

Keep a distinction between your source workspace and the directory delivered to the web server. The workspace can contain drafts, editor files, design sources, scripts, test fixtures and package settings. The public release normally contains just what clients need: pages, styles, image assets and approved scripts or downloads. A built application can produce all of those from a different source layout. Inspect the actual output directory instead of copying every file in the workspace to the hosting root.

For Mauli's rate sheet, create a candidate release with a known date and simple revision marker. Check the home page and nested rate page, each required asset, the intended content type and a missing path. Test from an isolated preview before replacing the live site's files. If your publishing mechanism can switch a prepared release as one operation, it can help keep the HTML and assets in agreement. Replacing a set of files at different times can temporarily expose pages that reference assets not yet present.

A known previous release gives the owner an approved recovery choice. Plan which directory or approved artifact you would restore and which checks would prove that old correct behavior again. Avoid assuming a previous web page is enough if its stylesheet, images or other required dependencies were removed. The production web server and any proxy or cache can still be using an approved current configuration. The rollback plan needs to account for how the public site selects and serves the files.

Use a release review that is narrow enough to verify. Compare the intended assigned hostname and document root, retain the previous known working version where the owner authorizes it, preserve unrelated sites and check the new response from the actual intended caller. If a candidate fails in a preview, repair it there. A class exercise does not justify replacing a shared server's default root or disabling another site's listener.

Explain why two browsers can briefly show different versions

At 10:00 Mauli publishes a corrected rates page. One visitor reloads and immediately sees the new number. Another still sees the previous rate. A browser or an intermediary can cache a response under the applicable HTTP rules and reuse that response for some time. Decide whether the server's active release, the delivered response or a reader's current view is being measured. These observations are related but can have different values.

Cache control headers help determine whether and when a response can be reused or revalidated. A fresh response under the applicable caching rules can be used again. A validation request can ask the server whether a previously stored representation is still current. A response such as 304 can tell the client to reuse its stored response information. Understanding these categories helps you avoid interpreting a missing response body during revalidation as a failed file upload.

Consider a change to the stylesheet. If an old browser cache still holds /assets/site.css under a previously cacheable result, a new HTML document can appear with an old style. A build can use versioned asset names, such as a filename containing a content-derived revision, so a new page references a new immutable address. The previous page may still reference the previous asset. Keep the files needed during the documented transition or rollback period. Always verify the actual requested URL and result instead of guessing what the browser has cached.

A training test can compare the approved origin's current response with what a client received. If a CDN or additional proxy is part of the actual design, check its documented behavior, configured policies, selected origin and cache freshness as appropriate. Clearing a browser's local cache may help reproduce a symptom but does not repair an incorrect origin deployment. Similarly, serving a correct origin response doesn’t prove every intermediary has refreshed its current representation. Record the version marker where each observation was taken.

Serve three files on loopback and watch one asset path fail

Use Python 3 locally. The example creates one home file, one nested rates file and one stylesheet in a fresh temporary directory. A Python HTTP server binds to a loopback socket selected by the operating system. Two HTML files initially refer to the same relative CSS text. Predict which page depth yields the correct asset path. There are no external requests, installed packages or edits to an existing site.

python3 - <<'PY'
from functools import partial
from http.server import SimpleHTTPRequestHandler, ThreadingHTTPServer
from pathlib import Path
from tempfile import TemporaryDirectory
from threading import Thread
from urllib.error import HTTPError
from urllib.parse import urljoin
from urllib.request import ProxyHandler, build_opener

with TemporaryDirectory(prefix="mauli-rates-static-") as temp:
    root = Path(temp)
    (root / "rates").mkdir()
    (root / "assets").mkdir()
    (root / "assets" / "site.css").write_text("body { color: #244; }\n")
    link = '<link rel="stylesheet" href="assets/site.css">'
    (root / "index.html").write_text(link + "<h1>Mauli training</h1>")
    rates = root / "rates" / "index.html"
    rates.write_text(link + "<h1>Rates exercise</h1>")
    handler = partial(SimpleHTTPRequestHandler, directory=temp)
    with ThreadingHTTPServer(("127.0.0.1", 0), handler) as server:
        worker = Thread(target=server.serve_forever, daemon=True)
        worker.start()
        opener = build_opener(ProxyHandler({}))
        start = f"http://127.0.0.1:{server.server_port}"

        def check(label, url):
            try:
                with opener.open(url, timeout=5) as answer:
                    print(label, answer.status, answer.headers.get_content_type())
            except HTTPError as error:
                print(label, error.code)
                error.close()

        try:
            check("home", start + "/")
            check("home CSS", urljoin(start + "/", "assets/site.css"))
            check("nested page", start + "/rates/")
            check("first nested CSS", urljoin(start + "/rates/", "assets/site.css"))
            rates.write_text(link.replace("assets/", "../assets/") +
                             "<h1>Rates exercise</h1>")
            check("corrected nested CSS",
                  urljoin(start + "/rates/", "../assets/site.css"))
        finally:
            server.shutdown()
            worker.join()
print("Temporary preview closed.")
PY

Expect home 200 with HTML, home CSS 200 with a CSS content type, the nested page 200 with HTML, the first nested CSS 404 and the corrected nested CSS 200. The server logs may also print each request on a separate stream. The two CSS checks use Python's URL resolution to model the browser paths. This script does not render the page or execute JavaScript. A permitted browser preview can confirm the visual styling if needed. The response test establishes which path the requests used and what HTTP answers followed.

Follow the nested URL through the setup. assets/site.css from the directory path /rates/ makes a request below rates, where no assets directory exists. The corrected ../assets/site.css goes back to the site root before using the known file. The HTTP server and filesystem permissions did not need a change for that proof. If your result differs, confirm the printed status and which path your program requested. Use the supplied worksheet instead of modifying a restricted workstation just to run the preview.

The server shuts down before the scratch directory is removed. The panel's temporary release includes no actual customer rates or credentials. If you saved the script separately, keep or remove it as a regular class artifact. A suitable public deployment uses the intended web server, access controls and publication procedure rather than exposing Python's simple teaching preview to other machines.

Review a candidate release with three changes and one deliberate regression

Use paper or your own disposable preview. The first release contains index.html, rates/index.html, assets/site.css and assets/shop.jpg. Release two updates the rates page, adds a dated revision marker and renames the image to Shop.jpg while leaving the HTML reference unchanged. Identify which public requests should succeed immediately under a normal case-sensitive release directory. Compare the home page, nested rates and image separately.

The two HTML requests can return correct 200 responses. The existing stylesheet should remain available. A request for the old lowercase image name can fail if the candidate no longer contains that exact file and the host uses a case-sensitive path. Test from the actual deployment model. A local environment that treats names as equal might mask the difference. The visual test would show a missing image even when the rates and styles look right.

Label the evidence you would need before publishing. Verify the intended base path and current release directory, the named resources, content type of each asset and expected response plus version marker. Confirm which file or link the candidate should retain. If the mismatched text was a mistake, update the intended filename or reference in your candidate and retest. Keep the earlier approved release available for a controlled rollback. Do not move or delete files from an unrelated live website to reproduce the exercise.

Now add a follow-up. The team observes that a vendor image remains old after the filename was correctly matched. Ask which browser or intermediary cached it, and verify the current approved origin response separately. A file's new bytes in the release folder and a browser's observed result can differ when caching applies. Record the requested path, returned body marker or safe checksum and observed state. The worksheet needs no cloud cleanup. Remove only the scratch files you created, if you made a local copy.

Describe when a displayed value was generated and who should see it

Compare three Mauli pages. The holiday notice is written and approved once. The daily rates table is exported from the shop's pricing tool at 08:00 and published at 08:30. The order tracking screen is for a signed-in customer and shows the current state of that order. The first two can use prepared static delivery even if one was generated by a program. The tracking screen may use prepared interface files too, but its live data depends on an authenticated runtime request. The important difference is when the value is selected and whose data it represents.

Make a publication checklist for the rates. Record which approved file or data export produced the public values, what time it represents, and which marker shows the correct release. If a price changes at noon, a static page can update after another build and publication. Decide whether a scheduled export meets the business requirement or whether every visit needs a data lookup. Faster publication is a different goal from closer-to-real-time personalized data. A file is suitable when the owner accepts the period it represents.

For the order page, public HTML can contain a place for the status to appear. The browser can request that status from an authenticated backend and display the result. Giving it a prepared JavaScript file does not move the server-side authorization decision into the browser. A private record needs the same identity and access checks as any other service request. An ordinary public object directory should not contain exported private records merely because browser code is supposed to hide the results.

Draw a timeline for the first rates release and for one personalized request. The rates timeline includes data collection, approval, publication and client request. The personalized timeline includes browser assets, account authentication and a permitted data request. Put evidence on each arrow. Use a release label and browser resource check for the first, and the authorized application response under the actual identity for the second. This helps a beginner choose what to verify when the wrong person sees a public rate or private order.

Recognize a default site response that came from the wrong root

One training machine serves a rate site and a separate help page. Both listen through the same Nginx or Apache process. Each site uses its own document root. The browser sends the hostname with the request, which can help choose the matching configuration on the listener. If you open a bare IP or use an unconfigured name, a selected default site can answer. That default response may return 200 because its files are valid. It does not prove your rate site was selected.

Write two expected observations. For rates.example.com the first heading says “Mauli training rates” and the root belongs to that site. For help.example.com the first heading says “Customer help” and the root is different. A browser request can return one heading while the administrator sees the right files for the other root. Check the hostname and mapping before copying files into another directory. Copying rate content into the default help site would solve the wrong problem and affect a separate service.

The scheme matters too. HTTPS involves a certificate that should verify for the intended server identity under the client trust rules. A correct HTTP host match does not create that certificate. When several HTTPS sites share a listener, the secure connection has a site-selection and certificate process before the application request is completed. A training deployment should test the intended named URL and maintain both the HTTP and HTTPS configuration as applicable. Do not ignore a certificate error just to demonstrate that some page can load.

Practice with an unambiguous release marker. Give each site a visible identifying line and one asset of its own. Compare the response at the intended URL with the separately authorized sites' baseline behavior. If you see a welcome page or the wrong marker, inspect listener, host selection and root. If only the CSS has the wrong marker, inspect the specific asset request and any cache. This decision tree protects other sites while you diagnose your own.

Audit what enters a publication directory before sharing its URL

The editor's workspace has a README, a source folder, process logs, old backup copies and the prepared output. A web server serves files under its allowed routes. File names such as draft.html or old-copy.zip do not keep those files private. If placed in a public document tree where the server allows access, they can become reachable even without an HTML link. Publish from a written list of intended artifacts or a controlled build output. Keep unrelated backups and authoring material outside that area.

For the exercise, mark each file public, private or build input. A reviewed public image and style belong in the candidate release. Draft pricing, account configuration and service logs belong in approved private locations. Source code and dependencies might be needed to generate the output without being needed for every visitor. JavaScript that the browser must run is intentionally delivered to clients, so its values and code can be inspected by recipients. Do not embed a backend secret in it and assume a build obscures it.

Build an evidence sheet with four checks. First, list the exact approved release files. Second, verify that the web server uses the directory intended by the site owner. Third, check the meaningful browser and asset routes using their actual names. Fourth, verify that a known nonexistent practice URL produces the agreed failure response. The last check helps distinguish normal missing-resource handling from an overbroad fallback. Keep these checks focused on your own release rather than probing unrelated directories or sites.

Some teams also compare a controlled content checksum or known version marker from the source of truth and the server response. That is helpful when a proxy or cache may be serving different bytes. It should be used with correct status, response type and application behavior. A checksum for a page cannot tell you that a stylesheet loaded. This audit gives an instructor a reliable way to verify the public artifact and its boundaries after a release.

Practice tracing a static page from its caller to the release

  1. Given a training root of /var/www/training-dairy and an index configuration for index.html, write the likely file for /, /rates/ and /assets/site.css. Name one rewrite or alias that would make simple root-plus-path mapping insufficient. Your answer should include the selected site and configuration.

  2. The project is published under /course/dairy/. Write the resolved URLs for a leading-slash asset link and a preference suitable for the nested rates page. Use the actual current page URL as the base. Explain why opening the file directly from Downloads cannot test those deployment rules.

  3. A build output contains a static home page, script and CSS. The script asks a service for a signed-in user's order. Draw one request per resource. Mark which responses can come from prepared asset files and which need runtime application logic or authorized data. A successful answer recognises the two roles in one website.

  4. Prepare expected response rows for an HTML page, stylesheet and absent image. Include protocol, known site host, path, expected HTTP status, content type and an identifying body detail. Write what you would review if the image or stylesheet URL gets the same HTML as the home page.

Interview questions and worked answers

What makes the rates page static?

The host can serve a prepared representation for the approved route without generating the page's business content per request. The contents can change in a new release. The browser can add local behavior or send separate runtime requests. Those other actions do not change how the prepared rates file was served.

Why does a working home page fail to prove all its assets work?

The browser requests styles, scripts and images separately and resolves their links from the page's actual address. Each request has its own URL and response. Check the expected status, content type and actual resource, including a nested page if its relative paths differ.

What happens when a request path is a directory?

Under the demonstrated configuration the server looks for an approved index file such as index.html. It can also redirect to a trailing slash, list a directory or reject the request under different settings. Confirm the intended document root and index behavior rather than treating a URL as a literal path alone.

Why might a stylesheet URL return 200 and still produce an unstyled page?

A server might return the wrong response at that path, such as an HTML fallback. The status only says a successful response was sent for the request under that handling. Verify the content type and body and check that the page asked for the intended stylesheet.

When would you host a static site on EC2?

EC2 can fit when you need control over the operating system and web server or want to learn those skills. A managed static hosting or object-and-CDN design can suit a different operating requirement. Compare runtime dependencies, access, performance, cost and maintenance under the actual design.

Check what the browser asked for and what the server serves

  1. What makes a browser-side product filter compatible with a static page? A. It can filter data already delivered to the browser. B. CSS must call a database for each visitor. C. All dynamic APIs are disabled by static HTML.

    Show answer

    A. Local computation can use already delivered content without changing how the server delivered the static files. An additional API may be used for another need. Static page delivery does not require every browser action to be precomputed.

  2. At /rates/, where does assets/site.css resolve for this example? A. /assets/site.css. B. /rates/assets/site.css. C. The browser machine's /var/www.

    Show answer

    B. A relative path is resolved from the URL's current directory. The server later maps that requested path to its own resources. The browser does not use the server's operating-system directory.

  3. Which result verifies that the actually requested asset is a usable stylesheet? A. A 200 for the home page. B. A 200 with expected CSS content type and CSS body at that path. C. An app tag named css.

    Show answer

    B. The resource itself needs the intended content and type. A home response alone does not check any separate asset. A fallback that sends HTML at the CSS URL can return 200 without loading the requested styles.

  4. What can explain a correct new origin file and one old client display? A. The client or intermediary may have cached a previous response. B. All static content is fixed forever. C. A browser must upload its own HTML.

    Show answer

    A. HTTP caching can preserve and reuse permitted responses. Compare the origin, actual client request and cache behavior under the configured path. A static site can publish updates.

  5. Which claim follows from a working loopback preview? A. The local HTTP request and expected file behavior worked. B. A public EC2 route now exists. C. The real site has the correct TLS certificate.

    Show answer

    A. The preview demonstrates local behavior. Public routing, security and TLS have their own configuration and intended client tests. Verify them only in the authorized public environment.

Revision cards

Prepared publication
Static serving uses files built or written before the request. A new release can change them.
Browser work
JavaScript and styles act in the client. A separate runtime data API is a different request.
Selected document root
The chosen site and its path handling determine the file. Directories can use an index.
Relative asset URL
Resolve the link from the actual page URL. Check nested paths and case on the intended host.
Response evidence
Inspect status, content type and body for each important path. A home 200 does not prove assets loaded.
Release and cache
Verify the candidate and a known recovery version. Check the observed response when caching is in use.

References