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

implement more caching & public cache api #2300

Merged
merged 6 commits into from
Aug 14, 2019

Conversation

WebFreak001
Copy link
Contributor

Allows to have runtime generated bodies with proper cache

For example you can cache runtime diet files with this: (with my runtime diet PR on diet-ng)

import diet.html;

if (handleCacheFile(req, res, "templates/client.dt", "public"))
	return;

res.writeBody(renderStaticHTMLDietFile("templates/client.dt"), "text/html; charset=UTF-8");

Copy link
Member

@wilzbach wilzbach left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am currently very low on time, so I didn't had a chance to look into the RFCs yet, but I already left some first comments. Great work!

http/vibe/http/fileserver.d Outdated Show resolved Hide resolved
http/vibe/http/fileserver.d Outdated Show resolved Hide resolved
http/vibe/http/fileserver.d Outdated Show resolved Hide resolved
http/vibe/http/fileserver.d Outdated Show resolved Hide resolved
web/vibe/web/rest.d Outdated Show resolved Hide resolved
http/vibe/http/fileserver.d Outdated Show resolved Hide resolved
@WebFreak001
Copy link
Contributor Author

(accidentally pushed irrelevant changes I made to fix tests on my machines, broke on linux and windows)

web/vibe/web/rest.d Outdated Show resolved Hide resolved
Allows to have runtime generated bodies with proper cache
@WebFreak001
Copy link
Contributor Author

ping @wilzbach @s-ludwig

Tested in firefox and chromium with properly working cache headers, adjusted code to reviews and rebased with master. Can I get another review or merge pls?

Copy link
Member

@wilzbach wilzbach left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looked a bit closer at https://tools.ietf.org/html/rfc7232#section-6 and it doesn't look like you follow it for all parts.

http/vibe/http/fileserver.d Show resolved Hide resolved
http/vibe/http/fileserver.d Show resolved Hide resolved
http/vibe/http/fileserver.d Show resolved Hide resolved
http/vibe/http/fileserver.d Show resolved Hide resolved
http/vibe/http/fileserver.d Show resolved Hide resolved
http/vibe/http/fileserver.d Outdated Show resolved Hide resolved
http/vibe/http/fileserver.d Outdated Show resolved Hide resolved
http/vibe/http/fileserver.d Outdated Show resolved Hide resolved
http/vibe/http/fileserver.d Show resolved Hide resolved
http/vibe/http/fileserver.d Outdated Show resolved Hide resolved
http/vibe/http/fileserver.d Outdated Show resolved Hide resolved
http/vibe/http/fileserver.d Outdated Show resolved Hide resolved
http/vibe/http/fileserver.d Outdated Show resolved Hide resolved
http/vibe/http/fileserver.d Outdated Show resolved Hide resolved
http/vibe/http/fileserver.d Outdated Show resolved Hide resolved
Copy link
Member

@wilzbach wilzbach left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@dlang-bot dlang-bot merged commit 86c75f9 into vibe-d:master Aug 14, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants