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
+13-13Lines changed: 13 additions & 13 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,14 +8,14 @@
8
8
Optimizing images helps reduce image weight and increases website loading speed, which is very important for both users and search engines. For these purposes, we have created a microservice that perfectly copes with this task.
9
9
10
10
Features:
11
-
- Resize images for the user's screen size,
12
-
- Image compressions to reduce traffic,
13
-
- Converting images to modern formats such as webp and avif,
14
-
- Works with dynamically content, compression occurs on the fly,
15
-
- High compression speed, an average picture is processed in just 200 ms,
16
-
- Includes exporter of metrics for Prometheus,
17
-
- Supports basic authorization for multiple domains and endpoints,
18
-
- Supports security restrictions for allowed addresses.
11
+
- Resize images for the user's screen size,
12
+
- Image compressions to reduce traffic,
13
+
- Converting images to modern formats such as webp and avif,
14
+
- Works with dynamically content, compression occurs on the fly,
15
+
- High compression speed, an average picture is processed in just 200 ms,
16
+
- Includes exporter of metrics for Prometheus,
17
+
- Supports basic authorization for multiple domains and endpoints,
18
+
- Supports security restrictions for allowed addresses.
19
19
20
20
### Try
21
21
To try the microservice features, run the container with the command:
-`-e PORT=3000` - the port on which the microservice will be launched, default 3000.
41
-
-`-e ALLOW_SIZES="100,200,1024-1920"` - an array of allowed sizes for the resulting images, default 100-1920. Use specific values to prevent heavy loads on the server.
42
-
-`-e ALLOW_SOURCES="https%3A%2F%2Ftb.mts.ru%2F"` - url array of allowed addresses for image sources, default * (any). Use comma as separator. It is recommended to apply encodeURIComponent to url.
43
-
-`-e BASIC_AUTHS="https%3A%2F%2Ftb.mts.ru%2F"` - an array of endpoints with basic authorization parameters, default empty. Has format encodeURIComponent("url"):encodeURIComponent("login"):encodeURIComponent("password"). Use comma as separator.
44
-
-`-e SHARP_CONCURRENCY=0` - number of threads libvips' should create to process each image, default 0 (will reset to the number of CPU cores).
40
+
- `-e PORT=3000` - the port on which the microservice will be launched, default 3000.
41
+
- `-e ALLOW_SIZES="100,200,1024-1920"` - an array of allowed sizes for the resulting images, default 100-1920. Use specific values to prevent heavy loads on the server.
42
+
- `-e ALLOW_SOURCES="https%3A%2F%2Ftb.mts.ru%2F"` - url array of allowed addresses for image sources, default * (any). Use comma as separator. It is recommended to apply encodeURIComponent to url.
43
+
- `-e BASIC_AUTHS="https%3A%2F%2Ftb.mts.ru%2F"` - an array of endpoints with basic authorization parameters, default empty. Has format encodeURIComponent("url"):encodeURIComponent("login"):encodeURIComponent("password"). Use comma as separator.
44
+
- `-e SHARP_CONCURRENCY=0` - number of threads libvips' should create to process each image, default 0 (will reset to the number of CPU cores).
45
45
46
46
### Components for web
47
47
To optimize images in the browser, there is a component for React. You can find it [by following the link](https://github.com/MobileTeleSystems/image-optimize-react). The component itself determines the most suitable image parameters and requests it from this microservice.
0 commit comments