mirror of
https://github.com/TeaOSLab/EdgeCommon.git
synced 2025-11-29 08:30:25 +08:00
增加页面优化相关API、配置、消息代号
This commit is contained in:
29
pkg/serverconfigs/http_page_optimization_css.go
Normal file
29
pkg/serverconfigs/http_page_optimization_css.go
Normal file
@@ -0,0 +1,29 @@
|
||||
// Copyright 2023 GoEdge CDN goedge.cdn@gmail.com. All rights reserved. Official site: https://goedge.cn .
|
||||
|
||||
package serverconfigs
|
||||
|
||||
import "github.com/tdewolff/minify/v2/css"
|
||||
|
||||
type HTTPCSSOptimizationConfig struct {
|
||||
IsOn bool `yaml:"isOn" json:"isOn"`
|
||||
|
||||
Precision int `yaml:"precision" json:"precision"`
|
||||
KeepCSS2 bool `yaml:"keepCSS2" json:"keepCSS2"`
|
||||
}
|
||||
|
||||
func NewHTTPCSSOptimizationConfig() *HTTPCSSOptimizationConfig {
|
||||
return &HTTPCSSOptimizationConfig{
|
||||
KeepCSS2: true,
|
||||
}
|
||||
}
|
||||
|
||||
func (this *HTTPCSSOptimizationConfig) Init() error {
|
||||
return nil
|
||||
}
|
||||
|
||||
func (this *HTTPCSSOptimizationConfig) AsMinifier() *css.Minifier {
|
||||
return &css.Minifier{
|
||||
KeepCSS2: this.KeepCSS2,
|
||||
Precision: this.Precision,
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user