Dev-related logs.
- ETag
- Cache-Control
- Expires
- Last-Modified
Cache busting is where we invalidate a cached file and force the browser to retrieve the file from the server.
We could add a version number to the filename:
assets/js/app-v2.min.js
We could add a fingerprint based on the file contents:
assets/js/app-d41d8cd98f00b204e9800998ecf8427e.min.js
We could append a query string to the end of the filename:
assets/js/app.min.js?version=2
To intercept HTTP requests, use the webRequest API. This API enables you to add listeners for various stages of making an HTTP request. In the listeners, you can:
get access to request headers and bodies, and response headers cancel and redirect requests modify request and response headers
Headers modified in webRequest.onHeadersReceived are not displayed in Netmonitor
-
Open a new tab and type in "about:networking" into the URL bar.
-
Go to the "Logging section"
-
Adjust the list of modules that you want to log:
Logging only HTTP request and response headers: Replace MOZ_LOG
=nsHttp:5
with MOZ_LOG=nsHttp:3
Nginx reverse proxy with code injection
Module ngx_http_addition_module
lua-gumbo
if is 'html', then cache it with content. After that, determine if the page is sent with ngx.arg[2]
if ngx.var.ishtml == "true" then
local data, eof = ngx.arg[1], ngx.arg[2]
ngx.var.content = ngx.var.content .. data
if eof == true then
....