Last active
August 11, 2020 04:02
-
-
Save pccasto/176329b389f46970a9d39be90a8a488d to your computer and use it in GitHub Desktop.
Plugin to set Jekyll/WEBrick to not send Cache-Control header field
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
# frozen_string_literal: true | |
# use this with a jekyll site during developement while using `netlify dev` for local testing. | |
# tested with Jekyll 4.1.1 | |
# plugin needed until this pull request is merged: https://github.com/jekyll/jekyll/pull/8331 | |
# | |
# this disables Cache-Control header from WEBrick, so that netlify Cache-Control can be set. | |
# add this file in the site's top-level/_plugins directory. | |
# | |
# this will throw a warning about duplicate definition of DEFAULTs, because there are two frozen definitions. | |
# but the first frozen definition will win. | |
require 'jekyll/commands/serve/servlet' | |
module Jekyll | |
module Commands | |
class Serve | |
class Servlet < WEBrick::HTTPServlet::FileHandler | |
DEFAULTS = {}.freeze | |
end | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment