New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

github.com/devetek/caddyserver-minifier

Package Overview
Dependencies
Alerts
File Explorer
Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

github.com/devetek/caddyserver-minifier

  • v0.0.0-20240124160716-8ca8b1aad3dd
  • Source
  • Go
  • Socket score

Version published
Created
Source

Caddyserver v2 Plugin - Minifier

Caddyserver v2 plugin that implements minification on-the-fly for CSS, HTML, JSON, SVG and XML. It uses tdewolff's library so, let's thank him!.

Syntax

Because this directive does not come standard with Caddy, you may use route to order it the way you want. For example:

Minimum configuration:

http://localhost:9200 {
	route {
		minifier
		reverse_proxy localhost:8097
	}
}

Partial configuration:

http://localhost:9200 {
	route {
		minifier {
			html {
				KeepDefaultAttrVals true
				KeepDocumentTags true
				KeepEndTags true
				KeepQuotes true
			}
		}
		reverse_proxy localhost:8097
	}
}

Full configuration:

http://localhost:9200 {
	route {
		minifier {
			html {
				KeepConditionalComments true
				KeepSpecialComments true
				KeepComments true
				KeepWhitespace true
				KeepDefaultAttrVals true
				KeepDocumentTags true
				KeepEndTags true
				KeepQuotes true
			}
		}
		reverse_proxy localhost:8097
	}
}

Todo

  • Support for another Content-Type (css, js, etc):
minifier {
 js
 css
}

Credit

Special thanks to @mholt for making a good documentation on how to use unstandard Caddy plugins, mholt/caddy-webdav

FAQs

Package last updated on 24 Jan 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc