Which pages of the site use a live server connection, which don't, and why.
The site is a Blazor Web App ("hybrid"). Every page is rendered on the server as plain HTML. A page only opens a live connection back to the server (a SignalR circuit, Blazor's "Interactive Server" mode) when it asks for one with @rendermode InteractiveServer at the top of the page.
The rule: a page is static unless it needs to change on screen without reloading. A form that posts and gets a new page back is not a reason; it works without a connection.
Why it matters
- Load speed. A static page is just HTML and CSS. There is no runtime to download (unlike WebAssembly) and no connection to set up (unlike a Server-only app, where every page opens one).
- Server memory. Every open interactive page holds a connection and some memory on the VPS for as long as the tab stays open. The site runs in a 384 MB container, so connections are kept for pages that earn them.
- Search and link previews. Static pages arrive as finished HTML, so search engines and chat link previews see the content.
- Reliability. A static page keeps working through a dropped connection or a server restart. An interactive page stops responding until it reconnects.
Static pages (no live connection)
| Page | Route | Why it is static |
|---|---|---|
| Home | / |
Reads compiled-in portfolio data. Nothing changes on screen. |
| Projects, Work, Software, Hobbies | /projects, /work, /software, /hobbies |
Lists of the same compiled-in data. |
| Item detail | /{category}/{slug} |
One portfolio entry. The back link is a normal link. |
| Not found | /not-found |
A message. |
| Sign in | /login |
A form that posts to the server and gets a redirect back. Signing in sets the cookie in that response, which a live connection cannot do. |
| Create an account | /register |
Same: a form post. |
| Access denied | /access-denied |
A message. |
| Menu (every page) | n/a | Links, the account area, and a sign-out form. The mobile toggle is a few lines of plain JavaScript, so the menu needs no connection. |
| Stack area | /stack |
Explanatory content, like the portfolio pages. Admin only. |
| Meeting request (planned) | /meetings |
A form that posts. Works without signing in, as the spec says. |
Server pages (live connection)
| Page | Route | Who can see it | Why it holds a connection |
|---|---|---|---|
| Members area (stub) | /members |
Anyone signed in | Hour requests will live here. The hours already booked for the week should update on screen as requests are made, without a reload. |
| Your profile | /members/profile |
Anyone signed in | Contact details form. See Profile and Projects. |
| Your projects | /members/projects |
Anyone signed in | Set up and describe projects: list, add, edit, delete. See Profile and Projects. |
| Admin (stub) | /admin |
Admin only | The admin tools (setting when I can be booked, managing requests) are working screens that update as I use them. |
| Time tracking | /admin/time |
Admin only | Punch-in / punch-out timer, setting hourly rates for different work types, deleting punches, and live updating duration. |
| Analytics | /admin/analytics |
Admin only | Page views by country, top pages and daily totals for a chosen period. See Analytics. |
Both stub pages have a button that counts clicks. It exists to show the connection works; replace it with real content.
Rules for choosing a mode for a new page
- Default to static. Start with no
@rendermode. - Use a form post (
EditForm method="post"withFormName) for anything that submits and then shows a result: sign-in, registration, the meeting request. - Make it interactive only if the screen must change without a navigation: live counts, filtering a list as you type, drag and drop, anything that talks back and forth while the page is open.
- Only signed-in areas should be interactive pages, and each should say why in the table above. Public pages stay static so a stranger's visit costs the server one request, not a connection.
- A component, not a page, can be the interactive part. If only a small widget needs a connection, put
@rendermode InteractiveServeron that component where it is used and leave the page static.
Security notes for interactive pages
- The
[Authorize]check on a page runs when the page is requested. While the connection stays open, the account is re-checked every 30 minutes (password changed or signed out elsewhere ends the connection's sign-in). - Check the role again inside any handler that changes data (
@onclickmethods, save buttons), not only on the page, because the handler runs over the connection. - Interactive pages are available only through pages the visitor was allowed to open: the connection's component data is signed by the server.
How the pieces fit
Routes.razoris static; it usesAuthorizeRouteViewso[Authorize]and[Authorize(Roles = "Admin")]decide who sees a page, and sends a signed-out visitor to/login?returnUrl=....- Accounts are two roles: Admin (created once from configuration, never through a form) and Member (everyone who registers). See Login.
- Offline support is provided through a Service Worker and PWA manifest. Public static pages and detail routes are pre-cached and can be fully downloaded via the offline manifest endpoint (
/api/offline-manifest), allowing the entire portfolio to work offline without a live server connection. Interactive server pages (/admin,/admin/time,/admin/analytics,/members,/members/profile,/members/projects) require live connectivity and display an offline notification when disconnected.