3 ms·
I call this hybrid static websites. It allows you to statially generate pages for even people who are logged in. It means the generation step is powered by inte
by samsquire 4y ago
I call this hybrid static websites. It allows you to statially generate pages for even people who are logged in. It means the generation step is powered by interaction with the static site. I use a special api.subdomain.tld proxy_pass to a server to trigger the site generation.
I wrote a forum that regenerated the static files when a post is added. Including the user's own account pages, those were statically generated too.
In theory a change to a user's account should only change that user's account pages.
I wrote a medium article about it. I was trying to get as many requests per second while logged in. It's an extension of the cache invalidation problem.
I got to 3288 requests per second on a virtual machine. A static site should get at least 12,000 requests per second. For reference, Visa and Mastercard process 40,000 requests in total per second for financial transactions. I use an nginx authenticator and Rust authentication program that talks to Redis to check the IP address of a user's session token in the URL. You could probbaly improve the performance further by using an embedded Lua script in Nginx and using that to authenticate IP address rather than doing a HTTP request for each request that the nginx authenticator does.
You can see the static site as a cache that needs to be updated based on new inputs.
https://medium.com/@samuelmichaelsquire/1633-requests-a-second-while-logged-in-3bca95cf3cf1 https://medium.com/@samuelmichaelsquire/1633-requests-a-seco...