Comments (4)
This is actually one of the things that is planned for Ring 1.2.0. The new not-modified middleware will handle "304 Not Modified" responses for handlers that return a response with a "Last Modified" or "Etag" header.
The next step is to change ring.util.response/resource-response
function to return a more headers, such as Last-Modified and, as you pointed out, setting the Content-Length would be a good idea as well.
from ring.
Here's a patch:
djpowell@89033af
- Adds Content-Length and Last-Modified to all resource-responses.
- Fixes a problem when directories paths are detected as resources.
from ring.
Would it be possible to open up a pull request for that? It makes keeping track of patches a little easier.
from ring.
This has been merged in.
from ring.
Related Issues (20)
- upgrade of Apache Commons FileUpload to 1.5 HOT 13
- Websocket support HOT 1
- The AES / CBC algorithm used in the cookie session store _might_ be insecure HOT 3
- Attributes in the `Set-Cookie` header are formatted incorrectly HOT 1
- How to measure time that it takes to complete a request? HOT 2
- Documentation for cookies HOT 2
- How to change UriCompliance mode HOT 2
- Streaming body issue with a synchronous ring handler HOT 4
- Add support for Partitioned cookies (CHIPS) HOT 1
- JettyWebSocketServerContainer can not implement WebSocketPolicy because it is not an interface HOT 4
- Reflection warnings HOT 2
- ring hangs when attempting to use websockets with :async? true HOT 3
- Catch up rename of `websocket-request?` to `upgrade-request?` in Wiki HOT 1
- How do I specify an optional field when accepting multipart-params for a request? HOT 1
- wrap-multipart-params creates an empty file when an empty file input is submitted HOT 4
- ring and ring-jetty-adapter 1.12.1 fails to work with simple example from wiki HOT 2
- cleaning up after a websocket goes aways is not clear HOT 4
- Update jetty-server HOT 3
- False positive circular dependency in wrap-reload due to as-alias HOT 2
- `(wrap-not-modified)` is better off removing `Content-Length` header from 304 Not Modified responses HOT 1
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 ring.