You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+5-7Lines changed: 5 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,8 +1,6 @@
1
1
# Nginx-Lua-minification-library
2
2
A compression and minification library to minify static or dynamic assets like HTML PHP outputs CSS style sheets JS Javascript all text/html or plain text mime types that nginx can output that the browser will read so they are small compressed and have white space removed as well as helping reduce bandwidth consumption since the files served from nginx webserver are now smaller.
3
3
4
-
> Please note, this script will only remove comments, white spaces and breaklines from your code. So, this mean it will not "rebuild" your files in order to minify the code. If you want something similar, I recommend using [Pagespeed](https://developers.google.com/speed/pagespeed/module/"Pagespeed") from Google
5
-
6
4
# Information :
7
5
8
6
I built this script to compress and keep the specified mime types outputs small and minify the bandwidth that my servers have to use when serving these files to users.
@@ -30,7 +28,7 @@ Once installed into your `nginx/conf/` folder.
30
28
Add this to your HTTP block or it can be in a server or location block depending where you want this script to run for individual locations the entire server or every single website on the server.
31
29
32
30
```
33
-
lua_shared_dict minify 10m; #Minified pages cache
31
+
lua_shared_dict html_cache 10m; #HTML pages cache
34
32
access_by_lua_file conf/lua/minify/minify.lua;
35
33
```
36
34
@@ -41,7 +39,7 @@ This will run for all websites on the nginx server
41
39
```
42
40
http {
43
41
#nginx config settings etc
44
-
lua_shared_dict minify 10m; #Minified pages cache
42
+
lua_shared_dict html_cache 10m; #HTML pages cache
45
43
access_by_lua_file conf/lua/minify/minify.lua;
46
44
#more config settings and some server stuff
47
45
}
@@ -52,7 +50,7 @@ This will make it run for this website only
52
50
```
53
51
server {
54
52
#nginx config settings etc
55
-
lua_shared_dict minify 10m; #Minified pages cache
53
+
lua_shared_dict html_cache 10m; #HTML pages cache
56
54
access_by_lua_file conf/lua/minify/minify.lua;
57
55
#more config settings and some server stuff
58
56
}
@@ -63,7 +61,7 @@ This will run in this location block only
0 commit comments