Open
Conversation
Contributor
Author
|
WIP, haven't add test case. |
79b95ce to
767dd6c
Compare
Member
|
I don't see how pre-compressed files can be served in hexo-server. I mean, most of the theme doesn't provide pre-compressed js & css. |
Contributor
Author
|
With a compression plugin like hexo-yam. How to test: package.json
- "hexo-server": "^1.0.0"
+ "hexo-server": "curbengh/hexo-server#pre-compressed",
+ "hexo-yam": "^3.1.0"_config.yml
+server:
+ pre_compressed: true$ rm -r node_modules/
$ npm i
$ hexo sCheck response header. |
275b510 to
bf427b2
Compare
Contributor
Author
|
Added test. |
curbengh
commented
Nov 17, 2019
Comment on lines
-40
to
-42
| extensions: | ||
| - html |
Contributor
Author
There was a problem hiding this comment.
Removed as they are not the default. User can always refer to https://github.com/expressjs/serve-static#options.
00dedba to
713ce74
Compare
curbengh
commented
Dec 28, 2019
8f75394 to
eb1c4f0
Compare
Contributor
Author
- fix compatibility with trailing .html
Contributor
|
I would say that hexo-server is a debug server only, not a prod server. Should absolutely not be used to serve a site except for testing! So in that context, really no need to have compression, pre compression, .... |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Serve pre-compressed assets when found, else fallback to dynamic compression (when both
compressandpre_compressedare enabled).compressis independent frompre_compressed, so either one can be enabled.Adapted from pre-compressed-assets middleware plus this fix, with es6 syntax and utilize hexo router (instead of node-glob).