Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IO::Handle serializers needed for efficient use of ConditionalGet #56

Open
kjetilk opened this issue Apr 2, 2012 · 2 comments
Open
Assignees

Comments

@kjetilk
Copy link
Contributor

kjetilk commented Apr 2, 2012

I talked a bit with miyagawa and mst in #plack, and ConditionalGET will do the if-none-match logic, but it is designed to make it easy to do the if-none-match stuff, if the computation of the message body is expensive, it needs some extra tricks.

If I understood them correctly, if the message body is a IO::Handle, then it will not read from that handle before it is needed, and in the case of a successful etag match, that will not happen, so if we are to save the cost of computing the message body, which is the expensive operation in our case, we need to have IO::Handle serializers.

I know there is a dev branch for this already, so this issue is about releasing it. I would guess that we might want to have the refactoring in the previous issue I submitted first though.

@kasei
Copy link
Owner

kasei commented Apr 2, 2012

It sounds like it's more than just needing an IO::Handle serializer, because for a conditional GET that should return 304 (Not Modified), we don't even want to execute the query. So the logic of executing the query would need to be moved inside the IO::Handle, and execution only occur when/if the handle is read from. These are the sorts of reasons why I implemented the Etag handling in RDF::Endpoint to begin with -- the existing middleware doesn't fit our execution model in this case. It's not just about saving IO, but also about saving CPU time and avoiding query execution when possible.

@ghost ghost assigned kasei Apr 2, 2012
@kjetilk
Copy link
Contributor Author

kjetilk commented Apr 2, 2012

hmmm, yeah, I can understand that... It is certainly something that shouldn't be high on the TODO list. It seems to me something that Plack cannot help us do, though it might be worth asking the #plack channel. Given that it is relatively straightforward to do, I suppose it might not be worth it.

@kasei kasei assigned kasei and unassigned kasei Jan 9, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants