Comments (4)
from the response header field, I'll add some real examples tonight haha. basically you'd set the etag etc as you normally would and do if (req.fresh) res.status(304)
, it's not really something you'd need to even touch for most cases since res.send()
does all that
from expressjs.com.
I was wondering if it might be intended to help with sending 304's for more dynamic pages. e.g. for applications with lots of read activity and only a little write activity, you might want to maintain a 'last updated' field in memory at some granularity level, then you could send 304's if that hadn't changed, without making db queries.
from expressjs.com.
yeah if you had "hot" content you could potentially circumvent a lot of the processing with custom 304 handling, the res.send() portion is still a win since you're not transferring a bunch of data but it's definitely preferred to optimize where applicable. we could probably add a nicer api on top of this stuff for that
from expressjs.com.
It would be good to have a request/response example that illustrates how to implement ETag support. Thanks!
from expressjs.com.
Related Issues (20)
- deno support HOT 2
- Document customizing `express.json()` size limit for specific routes HOT 1
- Got error when installing expressjs.com locally HOT 2
- Incorrect default value for dotfiles in docs for express.static HOT 1
- Express is made of many modules - Broken Link: ExpressJS StatusBoard HOT 1
- Debugging guide references DEBUG_FD environment variable which was removed from node debug module HOT 3
- How to set debug mode on Windows? HOT 2
- Res.Render documentation missing information. HOT 1
- How to flush a response? HOT 1
- Update 5.0 version in Migration Guide HOT 1
- Update security and performance best practices HOT 2
- Release change log page does not show the latest 2 versions HOT 4
- State minimum required version of Node.js HOT 5
- Review and Update v5.x Documentation against v4.x HOT 1
- Proposal to map out outdated translations HOT 1
- Add blog HOT 5
- Expand CI functionality to preview changes from PR HOT 6
- Broken link / domain squatter link on homepage HOT 2
- Nav links do not reppear after resizing HOT 3
- Ideas for blog content HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from expressjs.com.