perf(): assets cache and php perf improvement
This commit is contained in:
		| @@ -39,8 +39,8 @@ RUN echo "@community https://nl.alpinelinux.org/alpine/v3.7/community" >> /etc/a | |||||||
|  && gpg --import RainLoop.asc \ |  && gpg --import RainLoop.asc \ | ||||||
|  && FINGERPRINT="$(LANG=C gpg --verify rainloop-community-latest.zip.asc rainloop-community-latest.zip 2>&1 \ |  && FINGERPRINT="$(LANG=C gpg --verify rainloop-community-latest.zip.asc rainloop-community-latest.zip 2>&1 \ | ||||||
|   | sed -n "s#Primary key fingerprint: \(.*\)#\1#p")" \ |   | sed -n "s#Primary key fingerprint: \(.*\)#\1#p")" \ | ||||||
|  && if [ -z "${FINGERPRINT}" ]; then echo "Warning! Invalid GPG signature!" && exit 1; fi \ |  && if [ -z "${FINGERPRINT}" ]; then echo "ERROR: Invalid GPG signature!" && exit 1; fi \ | ||||||
|  && if [ "${FINGERPRINT}" != "${GPG_FINGERPRINT}" ]; then echo "Warning! Wrong GPG fingerprint!" && exit 1; fi \ |  && if [ "${FINGERPRINT}" != "${GPG_FINGERPRINT}" ]; then echo "ERROR: Wrong GPG fingerprint!" && exit 1; fi \ | ||||||
|  && mkdir /rainloop && unzip -q /tmp/rainloop-community-latest.zip -d /rainloop \ |  && mkdir /rainloop && unzip -q /tmp/rainloop-community-latest.zip -d /rainloop \ | ||||||
|  && find /rainloop -type d -exec chmod 755 {} \; \ |  && find /rainloop -type d -exec chmod 755 {} \; \ | ||||||
|  && find /rainloop -type f -exec chmod 644 {} \; \ |  && find /rainloop -type f -exec chmod 644 {} \; \ | ||||||
|   | |||||||
| @@ -56,6 +56,7 @@ http { | |||||||
|     root /rainloop; |     root /rainloop; | ||||||
|     index index.php; |     index index.php; | ||||||
|     charset utf-8; |     charset utf-8; | ||||||
|  |  | ||||||
|     client_max_body_size <UPLOAD_MAX_SIZE>; |     client_max_body_size <UPLOAD_MAX_SIZE>; | ||||||
|  |  | ||||||
|     location ^~ /data { |     location ^~ /data { | ||||||
| @@ -66,11 +67,38 @@ http { | |||||||
|       try_files $uri $uri/ index.php; |       try_files $uri $uri/ index.php; | ||||||
|     } |     } | ||||||
|  |  | ||||||
|  |     # Assets cache control | ||||||
|  |     # -------------------------------------- | ||||||
|  |     location ~* \.(?:html|xml|json)$ { | ||||||
|  |       expires -1; | ||||||
|  |     } | ||||||
|  |  | ||||||
|  |     location ~* \.(?:css|js)$ { | ||||||
|  |       expires 7d; | ||||||
|  |       add_header Pragma public; | ||||||
|  |       add_header Cache-Control "public"; | ||||||
|  |     } | ||||||
|  |  | ||||||
|  |     location ~* \.(?:gif|jpe?g|png|ico|otf|eot|svg|ttf|woff|woff2)$ { | ||||||
|  |       expires 30d; | ||||||
|  |       add_header Pragma public; | ||||||
|  |       add_header Cache-Control "public"; | ||||||
|  |     } | ||||||
|  |  | ||||||
|  |     # PHP Backend | ||||||
|  |     # -------------------------------------- | ||||||
|     location ~* \.php$ { |     location ~* \.php$ { | ||||||
|  |       try_files $uri =404; | ||||||
|  |       include fastcgi_params; | ||||||
|  |       fastcgi_split_path_info ^(.+\.php)(/.*)$; | ||||||
|  |       fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; | ||||||
|  |       fastcgi_param PATH_INFO $fastcgi_path_info; | ||||||
|  |       fastcgi_param HTTP_PROXY ""; | ||||||
|       fastcgi_index index.php; |       fastcgi_index index.php; | ||||||
|       fastcgi_pass unix:/tmp/php-fpm.sock; |       fastcgi_pass unix:/tmp/php-fpm.sock; | ||||||
|       fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; |       fastcgi_intercept_errors on; | ||||||
|       include /etc/nginx/fastcgi_params; |       fastcgi_request_buffering off; | ||||||
|  |       fastcgi_param REMOTE_ADDR $http_x_real_ip; | ||||||
|     } |     } | ||||||
|  |  | ||||||
|   } |   } | ||||||
|   | |||||||
| @@ -1,13 +1,13 @@ | |||||||
| [global] | [global] | ||||||
| daemonize = no | daemonize = no | ||||||
|  | error_log = /tmp/php_error.log | ||||||
|  |  | ||||||
| [www] | [www] | ||||||
| listen = /tmp/php-fpm.sock | listen = /tmp/php-fpm.sock | ||||||
| pm = dynamic | pm = ondemand | ||||||
| pm.max_children = 5 | pm.max_children = 30 | ||||||
| pm.start_servers = 2 | pm.process_idle_timeout = 10s | ||||||
| pm.min_spare_servers = 1 | pm.max_requests = 500 | ||||||
| pm.max_spare_servers = 3 |  | ||||||
| chdir = / | chdir = / | ||||||
| php_admin_value[expose_php] = Off | php_admin_value[expose_php] = Off | ||||||
| php_admin_value[post_max_size] = <UPLOAD_MAX_SIZE> | php_admin_value[post_max_size] = <UPLOAD_MAX_SIZE> | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 Hardware
					Hardware