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

commented Apr 12, 2019

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

left a comment

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 WebFreak001 force-pushed the WebFreak001:cache-apis branch from e0317a7 to 4ee772b Apr 19, 2019
@WebFreak001

This comment has been minimized.

Copy link
Contributor Author

commented Apr 19, 2019

(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
WebFreak001 added 2 commits Apr 12, 2019
Allows to have runtime generated bodies with proper cache
@WebFreak001 WebFreak001 force-pushed the WebFreak001:cache-apis branch from 4ee772b to 3cc5ea5 Jul 12, 2019
@WebFreak001

This comment has been minimized.

Copy link
Contributor Author

commented Jul 13, 2019

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

left a comment

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

left a comment

Thanks!

@wilzbach wilzbach added the auto-merge label Aug 14, 2019
@dlang-bot dlang-bot merged commit 86c75f9 into vibe-d:master Aug 14, 2019
3 checks passed
3 checks passed
codecov/patch 0% of diff hit (target 31.927%)
Details
continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.