gospodinwizard Posted December 7, 2022 Posted December 7, 2022 Just out of curiosity, is there a way to configure ThirtyBees to host product images on a different server from that on which the store software is located?
0 datakick Posted December 7, 2022 Posted December 7, 2022 Advanced Parameters > Performance > Media Servers Note that this also affects other assets like css and js files. And some modules (and maybe even some core code) sometimes generates direct url, so you still have to keep the original images on your server.
0 gospodinwizard Posted December 7, 2022 Author Posted December 7, 2022 6 hours ago, datakick said: Advanced Parameters > Performance > Media Servers Note that this also affects other assets like css and js files. And some modules (and maybe even some core code) sometimes generates direct url, so you still have to keep the original images on your server. Thank you.
0 Raymond Posted Friday at 05:03 PM Posted Friday at 05:03 PM Hello On a pristine TB 1.6 installation using PHP 8.3, no 3rd party templates, TB updated via core updater to match the PHP version (in core updater I get all green OK). Friendly URLs activated. I Tried with all CCC, cache, one page cache options enabled, disabled and mixed combos I tried to use media server as follows. I created a subdomain, media.mywebsite.com, I issued a letsencrypt SSL certificate for the same... In TB I settled this media server media.mywebsite.com I copied the img folder into the root of this subdomain media.mywebsite.com I saved and tested. The website loads the homeslider and beesblog module images but not the products' images I checked the URLs where the images should be and I saw that: The URL of the homepage slider and the beesblog modules' images are just what I thought they had to be, they look like this media.mywebsite.com/img/whicheverfoldershouldcontaintheimage/image.webp(jpg for beesblog) The URL of the products' images are not what I thought had to be, I imagined somewhat like media.mywebsite.com/img/whicheverfoldershouldcontaintheimage TB rewrites the products' URLs as follows: media.mywebsite.com/products/1-Niara_home/whateverimageshouldbeshown.webp(or other file format settled in images preferences) I checked the URL of another product image and results to be similar, but with 15-Niara_home, so each has a different "N-Niara_home" folder in the URL I searched in the mywebsite.com root filesystem for such N-Niara_home folders, and found none... I imagined that had to be so, but wanted to check if I had to copy other folders in the media.mywebsite.com subdomain... I also tried to disable apache multiview and mod security, nothing changed (I have no idea if those are related, however I tried...) Finally I disabled the friendly URL function, tested and all images appeared in the front end as expected, I imagine thus all of this has to do also with .htaccess I tried to fiddle with .htaccess too, but to no avail... Why is this happening? How can I correctly use media servers? Thank you in advance for any help.
0 the.rampage.rado Posted Friday at 05:53 PM Posted Friday at 05:53 PM Media servers in thirty bees should not be used as you did - make new copy of your files and put it on another place on your file system. Not at least if you only use one server. Point your media domain to the same folder where the website is. That way the shop will request all product images from the media server which will look in your current img folder and find what it needs. Don't forget to clear your cache and regenerate your htaccess after you make changes to the media servers as information should be automatically written there.
0 Raymond Posted Friday at 06:46 PM Posted Friday at 06:46 PM Hi Rampage.Rado I did follow your hint, it worked, but does make no difference about cookie free image serving. I understand that usually a media server should be a CDN or at least another server, or more servers, but I read that a subdomain would do the trick, there is nothing wrong about in principle. Of course a CDN or more servers, maybe geolocated in strategical points, would be useful to fast serve media and avoid use cookies (I do not know if TB can decide form which server send the images/media accordingly to geolocation of the client, however....). Actually I wanted to just avoid use cookies. To check if the media serving is going fine I do use a website, e.g. https://tools.pingdom.com , that analyses a website speed and other basic features, among which the use of cookies for images/media. After using your workaround I thus checked the website on pingdom.com, and the result did not change, for what is concerning the "Use cookie-free domains" thing I get a score of 50 with a low F mark + the advice to avoid using cookies for images, just as if the media server is not used. Paradoxically while I was testing the failed method I described in my previous post, the media server at least for homeslider and beesblog worked fine, therefore on pingdom I was getting a higher score and a B mark, still got the advice to use cookie free images (of course, all product's images were not served at all in practice + maybe cookies were still detected for those images... dunno...). I have another server too, it ha s adifferent IP, I do try to place the img folder there, however, I am sensing that I am missing something basilar, some kind of trouble with rewriting stuff/.htacces or some configuration Thank you for the hints Best regards
0 the.rampage.rado Posted Friday at 08:45 PM Posted Friday at 08:45 PM If you want to serve the images under different ip you will have to figure out automatic sync of the files. The approach i suggested is delivering cookieless images but only for the core - products, categories, etc. Modules will continue to be served from the main domain, thus you saw increase in points because core images were replaced with question mark image which is very small.
0 Raymond Posted 3 hours ago Posted 3 hours ago If using same domain for TB installation and media server. The subdomain one use as mediaserver must be settled with a CNAME pointing to the root of the domain (or subdomain) in which TB is installed. The servers one is using also must be configured accordingly, each must know that the subdomain working as mediaserver is pointing to the domain or subdomain that is serving TB. The result is almost good, not completely tough as at least beesblog continue to serve images from the main domain/subdomain on which TB is installed. Even disabling the blog still some things are not served by the media server. I also still have a trouble with a raleway woff font, which cannot be served due to cors issues. the other raleway font weights, which are woff2 btw, do work. Still could not understand and could not solve this...
Question
gospodinwizard
Just out of curiosity, is there a way to configure ThirtyBees to host product images on a different server from that on which the store software is located?
7 answers to this question
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now