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
The module retrieves files in /media from an origin server.
1
+
# Media Storage Sync
2
+
*This project is a fork of [this repo](https://github.com/PHOENIX-MEDIA/magento2-mediastoragesync). Since it was no longer maintained, and contained critical bugs, we haved decided to continue maintaining it, under a new name. Kudos to [Phoenix Media](https://www.phoenix-media.eu/de/) for their work.*
3
+
---
4
+
The module retrieves files in /media from an origin server/url. Useful if you have a local development environment for your shop, and don't want to download the whole media folder along with the shop.
3
5
4
-
### What it does
6
+
This module will try to download the images from the provided url, as they are required.
7
+
8
+
## What it does
5
9
6
10
Imagine you have a fresh local development environment with the Magento code checked out.
7
11
You retrieved the database but you don't have any of the media assets and your store frontend
@@ -14,7 +18,7 @@ products and CMS blocks/pages from a configurable origin server similar to a CDN
14
18
you load an entity from the database. This means you can forget about the media folder and
15
19
just browse the frontend as images are downloaded and saved transparently.
16
20
17
-
###How it works
21
+
## How it works
18
22
19
23
In the module's configuration you can configure a base URL, the domain where your production/staging
20
24
Magento instance is located from which to picked the database. In the database the relative
@@ -23,34 +27,30 @@ simply checks if their images are already in media/catalog. If not it uses the b
23
27
appends the relative image path from the database and downloads the files from origin server.
24
28
This slows down page generation the first time you access a page but improves pretty quickly.
25
29
26
-
For other assets in the media folder we make use of another mechanism: Maybe you recognized
27
-
Magento is shipped with a get.php file in the Magento root. It was intended to retrieve image
28
-
data from a database, save it on the host's filesystem and then deliver it. Well, our assets
29
-
are located at a different web server but beside the retrieval of the asset data the rest is
30
-
pretty similar.
31
-
The get.php is called via a mod_rewrite rule in the media/.htaccess or equivalent rules in
32
-
your nginx configuration. The process is triggered every time a file in /media is not found
33
-
so it is only triggered the first time. The MediaStorageSync module downloads the file, saves
34
-
it and the get.php delivers the file. On the second load the web service can directly deliver
35
-
the static asset.
30
+
## Settings
36
31
37
-
### How to use
32
+
-`Enable` - Self explanatory
33
+
-`URL` - The url full url of the shop you want to download medias from (e.g. https://yoursite.com/)
34
+
-`HTTP Client User`- Username, in case of need for authorization
35
+
-`HTTP CLient Password`- Password, in case of need for authorization
36
+
-`Download Limit Per Request`- Limit the amount of downloads per request
0 commit comments