m3442a Posted May 22, 2015 Share Posted May 22, 2015 (edited) Hello, i have two problems with activated CDN and CCC for CS and JS. I created a CDN Push Area and moved my files to the CDN. If i activate the Media Servers in BO, my Images are broken and dont work (404), the redirect to the right path dont work anymore. For example: Without CDN everything ok:Local Path for the Image /img/p/2/1/5/215-picture_default.jpg and the the rewrite shows/215-zoom_default/product_name.jpg With CDN Local Path in the Image/img/p/2/1/5/215-picture_default.jpg and the the rewrite shows/215-zoom_default/product_name.jpg but PS says 404 and the images not shows, because the rewrite to the local path dont work, the system looking for cdnserver/215-zoom_default/product_name.jpgand not cdnserver/img/p/2/1/5/215-picture_default.jpg so the local image cannot be found I try to change this Script in classes/Link.php: if ($this->allow == 1)$uri_path = _PS_BASE_URI_.$id_image.($type ? '-'.$type : '').$theme.'/'.$name.'.jpg';else$uri_path = THEME_PROD_DIR.Image::getImgFolderStatic($id_image).$id_image.($type ? '-'.$type : '').$theme.'.jpg'; change it to if ($this->allow == 1)$uri_path = THEME_PROD_DIR.Image::getImgFolderStatic($id_image).$id_image.($type ? '-'.$type : '').$theme.'.jpg';else$uri_path = THEME_PROD_DIR.Image::getImgFolderStatic($id_image).$id_image.($type ? '-'.$type : '').$theme.'.jpg'; After that the Images Show but only the local path /img/1/2/3/123.jpg and not the rewrited path. The Second issue if i activate CCC for Css and JS also activate the CDN Media Settings the cache files written in the domain.com/themes/theme-name/cache instead to cdn.domain.com/themes/theme-name/cache/ so i became errors the cached CSS and JS File not found on the CDN Server. How its this possible to create the cache files in the right path if i activate CDN,? correct path is the CDN cache path I looking myself on classes/media.php - > public static function cccCss($css_files) but dont have luck. Have someone similar issue or solution for that problem? thanks for help Edited May 22, 2015 by m3442a (see edit history) Link to comment Share on other sites More sharing options...
Dh42 Posted May 22, 2015 Share Posted May 22, 2015 You can set your CDN to pull and it will be a lot easier and work. Link to comment Share on other sites More sharing options...
m3442a Posted May 23, 2015 Author Share Posted May 23, 2015 Hello Dh42, this is the easiest way correct but not the fastest. With push method is my site more faster than with pull. so this is not a solution for that problem Link to comment Share on other sites More sharing options...
m3442a Posted May 23, 2015 Author Share Posted May 23, 2015 (edited) Generally question is: Can i use CDN Push Method with Prestashop or only CDN Pull? This time we have traffic problems with own server and i am not sure which method is better for traffic balancing Edited May 23, 2015 by m3442a (see edit history) Link to comment Share on other sites More sharing options...
m3442a Posted May 23, 2015 Author Share Posted May 23, 2015 UPDATE: I activated a pull zone and have the same issue - > the cached file was not found on pullzone/themes/theme-name/cache/v_cachefile.css, the images working Link to comment Share on other sites More sharing options...
Dh42 Posted May 23, 2015 Share Posted May 23, 2015 I have done a lot of testing, what makes you think a push zone is faster? But to answer your questions, if you have a pull zone set up it should pass through to the server if it does not have a file cache. If that isn't working something is wrong with your setup or your cdn. But to answer your question, PrestaShop will work with a push zone, but it is more difficult to set up. What you would need to do is map your pull zone into your file system for your image directory, and your theme cache directory. What CDN are you using? Are you trying to load balance with front end nodes? It is different if you are doing that. Link to comment Share on other sites More sharing options...
m3442a Posted May 23, 2015 Author Share Posted May 23, 2015 thanks for your quick reply. I use actual KeyCDN. Have you a workaround how configure the shop for the push zone? or more details? if you do a testing, you know how it works. Link to comment Share on other sites More sharing options...
m3442a Posted May 29, 2015 Author Share Posted May 29, 2015 The settings now to Pull. Yes its easier and work, but only with images. If i activate the CCC for CSS and JS the caches files under /themes/theme/cache not found Link to comment Share on other sites More sharing options...
prcwest Posted August 6, 2018 Share Posted August 6, 2018 On 5/23/2015 at 3:05 AM, Dh42 said: I have done a lot of testing, what makes you think a push zone is faster? But to answer your questions, if you have a pull zone set up it should pass through to the server if it does not have a file cache. If that isn't working something is wrong with your setup or your cdn. But to answer your question, PrestaShop will work with a push zone, but it is more difficult to set up. What you would need to do is map your pull zone into your file system for your image directory, and your theme cache directory. What CDN are you using? Are you trying to load balance with front end nodes? It is different if you are doing that. hello I was reading on your website the article "Prestashop and Media Servers". Can this setup be applied for prestashop 1.7.4.2? is it always the same? Best regards Link to comment Share on other sites More sharing options...
Dh42 Posted August 6, 2018 Share Posted August 6, 2018 It generally can be, but using fake media servers is not suggested any more. If you are using a real CDN it should work fine though. Link to comment Share on other sites More sharing options...
prcwest Posted August 6, 2018 Share Posted August 6, 2018 8 hours ago, Dh42 said: It generally can be, but using fake media servers is not suggested any more. If you are using a real CDN it should work fine though. Thanks for your response and the great article. i still would like to try this and i checked but cant find the editorial module and the blockadvertising module what needs to be copied to the img/modules folder. any advice would be appreciated. Best regards Link to comment Share on other sites More sharing options...
Dh42 Posted August 6, 2018 Share Posted August 6, 2018 I think those modules might have been discontinued in 1.7 Link to comment Share on other sites More sharing options...
Dh42 Posted August 6, 2018 Share Posted August 6, 2018 Oh, also if you are doing this with fake media servers, because of the changes on the internet, its going to slow your site down, not speed it up. Link to comment Share on other sites More sharing options...
prcwest Posted August 6, 2018 Share Posted August 6, 2018 4 minutes ago, Dh42 said: Oh, also if you are doing this with fake media servers, because of the changes on the internet, its going to slow your site down, not speed it up. understood. thank you Link to comment Share on other sites More sharing options...
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