Jump to content
Mephivio

CloudFlare Help Request

Recommended Posts

Hi Team,

 

i try to use CloudFlare for a customer.

CloudFlare is an amazing solution mixing reverse proxy, firewall and proxy.

 

The only problem is IP addresses.

In fact ip addresses are coming from the proxy and not from the real source.

They propose several solutions to resolve this problem.

 

One of them is to add one specific mod to apache : i dont't like it

There are some extensions for wordpress, joomla, drupal but nothing for prestashop.....

i contact CloudFlare : the answer they will have a look in the next generation.

 

i think that's not very complex to adapt a joomla or wordpress module for prestashop. it seems core of their modules are the same... who can help ?

 

Regards,

JP

Share this post


Link to post
Share on other sites

Hi Citrix,

you only need the real ip for the statistic modules in prestashop e.g. country distribution. I tested cloud flare for one or two days but the pagination in the backend (ps 1.2.5) was not working any more. The support did not reply although I gave the limited access to the backend to investigate. I made a lot of site speed tests but the improvement was not so huge compared to the disadvantages. If you don't have an international site you don't need cloudflare and if you have you should consider that you never know exactly if customers can reach your site in certain countries, impact on SEO etc.pp.

The statistics in cloudflare gave misleading information which were depending on which timescale I used.

The first day I tested my orders got down to zero which might be coincidence or customers were mistakenly identified as bots or whatever.

You can imagine what happens if a potential customer is falsly identified as a bot he is challended with a captcha to be identified as a human. I think a false positive customer will imediatly leave your site and maybe a customer/order is lost. It is a difference if someone can not read your blog or if you loose orders.

 

Maybe I would recommend to configure cloudflare to a subdomain where your images/ccs are stored and use the media server in preferences to accelarate your media files but leave the main domain untouched.... but if you use ssl you need to purchase a premium account which is not so cheap and as I said ... there are from my point of view few cases where the drawbacks outrule the advantages of cloudflare.

I think the whole idea behind cloudflare is great and I'll keep an eye on them but at the moment I would be carefull espacially if you already have running buiseness.

Best regards, trip

Share this post


Link to post
Share on other sites

Hey guys, are you both still using Cloudflare? I am considering signing up a PS 1.4.7 shop and would like to know more about your experience with Cloudflare, difficulties, etc... Thanks!!

Share this post


Link to post
Share on other sites

We use CloudFlare in our shop ~8 week's. Our experience with it is very good - if you add special, additional subdomain like tools.myshop.com and not allow cloudflare to cache content from this subdomain you can normally do enything in you shop BO.

 

This subdomain ex. tool.myshop.com is usefull becouse you no need to go in CloudFlare settings and disable the caching for ex. development mode (which swich off cloudflare funcionality for ~3 hours.)

Share this post


Link to post
Share on other sites

Hi Zacha,

 

is setting up a subdomain for the BO a necessity to make it work? I am not sure what changes would need to be made to the PS files to run the BO from a subdomain.

 

Thanks in advance for your clarifications!

 

Dan

Share this post


Link to post
Share on other sites

Hi lowlight,

 

thanks for the reply, that's good to know! I'm definitely going to give CloudFlare a shot asap!

 

Thanks! And have a great day!

 

Dan

Share this post


Link to post
Share on other sites

recently, i have tested cloudflare.

 

but, there are problem i can't solve.

 

1. in BO i can't change to other page (shipping - country menu)

2. in BO some modules does not work(sms-prestashop)

3. it is most critical - after check out thru paypal customer see site offline message.

Share this post


Link to post
Share on other sites

The best way to use cloudflare is to use 2 domains.. One main where your site will be hosted and the other for media content. e.g .com as main and .net for media.

 

Register cloudflare for .net domain. In the BO->Performance->Media server put the domain of .net. Now all your media content will flow through cloudflare and rest will come directly to your servers.. You will find no issues anywhere.

 

I personally feel that for your customers data security you use CDN for only media and not for whole site and keep the media seperate using different domain.

  • Like 2

Share this post


Link to post
Share on other sites

 

 

1. in BO i can't change to other page (shipping - country menu)

3. it is most critical - after check out thru paypal customer see site offline message.

 

I also have the same issues.. any help will be appreciated.

Share this post


Link to post
Share on other sites

The best way to use cloudflare is to use 2 domains.. One main where your site will be hosted and the other for media content. e.g .com as main and .net for media.

 

Register cloudflare for .net domain. In the BO->Performance->Media server put the domain of .net. Now all your media content will flow through cloudflare and rest will come directly to your servers.. You will find no issues anywhere.

 

I personally feel that for your customers data security you use CDN for only media and not for whole site and keep the media seperate using different domain.

 

Can you please explain how to create a media server and how to point the files ( images) to the products?

 

Can I create a subdomain and get the same result or it needs to be a separate domain?

Share this post


Link to post
Share on other sites

Hello meccabooks

 

I had my host set-up cloudflare for me and they set-up a media server without opening another domain. Not sure if you use a shared server or vps is what I use. You may want to speak with your host if your unsure. I do know that cloudflare is awesome

Share this post


Link to post
Share on other sites

@ premanshu: thanks for the great advice on how to set up Cloudflare. I am still unsure though how to set up the media files on the second server.

 

Should I copy-paste and upload the folder structure of my PS media files to the media server, or how should this whole file thing work?

 

Thanks so much for your help, I appreciate!

Share this post


Link to post
Share on other sites

I just got done testing Cloudflare, here are the results, Prestashop and Cloudflare Also I have a howto on setting your site up with media servers on my site too.

Share this post


Link to post
Share on other sites

@ premanshu: thanks for the great advice on how to set up Cloudflare. I am still unsure though how to set up the media files on the second server.

 

Should I copy-paste and upload the folder structure of my PS media files to the media server, or how should this whole file thing work?

 

Thanks so much for your help, I appreciate!

 

You do not have to setup a media server. Just ask your hosting provider to create a symbolic link of your media domain pointing to the directory of your main domain.

 

e.g. In direct-admin panels the main directory where domain points is domain/public_html

 

If you type your main domain say abcd.com then it will point to public_html directory. Usually prestashop is installed in the same directory. So your img directory path will be like abcd.com/public_html/img.

 

Ask your hosting provider to make a symbolic link of your second domain(xyz.net) public_html directory pointing to public_html of abcd.com. so if you try to access xyz.net/public_html/img it will try to access files of abcd.com/public_html/img automatically.

 

Now configure this second domain in cloudflare and use it as mediaserver in prestashop. If you are able to make this work then add more domains with this approach.

 

The reason to use this approach is that it will save you from effort of syncing files each time from your main domain to media domain whenever you make changes to your template or add a new product to shop.

Edited by premanshu (see edit history)
  • Like 1

Share this post


Link to post
Share on other sites

You don't have to sync, you set your media server up and change the location in your defines.inc.php file. I don't think your way of doing it will actually make it server a cookie free resource. Here is an article on how to set up the media servers correctly. http://blog.dh42.com/prestashop-and-media-servers/ if you are using ssl, you will need a wild card cert though.

Share this post


Link to post
Share on other sites

@ DH42: many thanks for the great comparison on PS with and without Cloudflare. Surprising result!

 

Maybe on pages with lots of separate graphic elements Cloudflare might actually speed up things, but after reading your review, I think I will not use Cloudflare on my website for now, don't think it will speed anything up considering how I have optimized my website.

Share this post


Link to post
Share on other sites
You don't have to sync, you set your media server up and change the location in your defines.inc.php file. I don't think your way of doing it will actually make it server a cookie free resource. Here is an article on how to set up the media servers correctly. http://blog.dh42.com/prestashop-and-media-servers/ if you are using ssl, you will need a wild card cert though.

 

Hi DH42,

I have done the steps and my web speed did improved, but the pictures for the products are gone... :(

 

I have just changed back to default.

 

Did I do anything wrong?

 

I had follow all the steps, except moving the folders.

 

Instead of moving the folders, I copy the folder to the required directory.

 

Also for the modification of the file "defines.inc.php"

do we need to modify "defines.inc.php" or "defines_uri.inc.php"?

Share this post


Link to post
Share on other sites

Are you using Prestashop 1.4? This article was written for prestashop 1.4, I haven't really looked at what needs to be done to make it work in 1.5 yet.

Share this post


Link to post
Share on other sites

Are you using Prestashop 1.4? This article was written for prestashop 1.4, I haven't really looked at what needs to be done to make it work in 1.5 yet.

 

oh!!!!!!

Yeah I am using 1.5...

ok ok

any idea how to enable the cloudflare?

like the page rules in cloudflare. I am getting confused...

Share this post


Link to post
Share on other sites

Cloudflare really doesn't help the loading times the way that you are wanting them to be helped. More than likely your bottle neck is coming from either your sql requests taking too long or your server does not have enough processing power to spit out the compiled files quick enough.

 

ftp into your site and set your /config/defines.inc.php to true on debug profiling. What it will do is time all of the executions and print them out at the bottom of the page. Send me a screen shot of what it prints out at the top of the bottom of the page, something like this. http://blog.dh42.com/wp-content/uploads/2013/07/apc.jpg

Share this post


Link to post
Share on other sites

Cloudflare really doesn't help the loading times the way that you are wanting them to be helped. More than likely your bottle neck is coming from either your sql requests taking too long or your server does not have enough processing power to spit out the compiled files quick enough.

 

ftp into your site and set your /config/defines.inc.php to true on debug profiling. What it will do is time all of the executions and print them out at the bottom of the page. Send me a screen shot of what it prints out at the top of the bottom of the page, something like this. http://blog.dh42.com...2013/07/apc.jpg

 

any idea how to do that?

 

i can use filezilla to go to config/defines.inc.php, then next time is?

Share this post


Link to post
Share on other sites

i also getting mailchimp error...

 

[php User warning #512] Function addCSS() is deprecated in /home/mysite/public_html/modules/mailchimp/mailchimp.php on line 149
(/home/mysite/public_html/classes/Tools.php, line 1845)

Share this post


Link to post
Share on other sites

Can you try disabling the mail chimp module and see if you get the readout at the bottom of your site

Share this post


Link to post
Share on other sites

still the same after i uninstall mailchimp

 

when i change this

then i will get the mailchimp error

 

define('_PS_MODE_DEV_', true);

Edited by cutecat (see edit history)

Share this post


Link to post
Share on other sites

Don't put the shop in dev mode, just turn on the debug profiler.

 

Also are you hosted in singapore? If so are you testing locally for speed times? I have found that things coming in or off the island operate slow. Like if I have a site in europe it is slow for people in singapore or a site in singapore is slow for people in europe.

Share this post


Link to post
Share on other sites

Don't put the shop in dev mode, just turn on the debug profiler.

 

Also are you hosted in singapore? If so are you testing locally for speed times? I have found that things coming in or off the island operate slow. Like if I have a site in europe it is slow for people in singapore or a site in singapore is slow for people in europe.

 

when i turn on. I get these errors

Fatal error: Uncaught exception 'Exception' with message 'Serialization of 'SimpleXMLElement' is not allowed' in /home/mysite/public_html/tools/profiling/Controller.php:267 Stack trace: #0 /home/mysite/public_html/tools/profiling/Controller.php(267): serialize(Object(Context)) #1 /home/mysite/public_html/tools/profiling/Controller.php(310): Controller->sizeofvar(Object(Context)) #2 /home/mysite/public_html/tools/profiling/Controller.php(237): Controller->displayDebug() #3 /home/mysite/public_html/classes/Dispatcher.php(349): Controller->run() #4 /home/mysite/public_html/index.php(28): DispatcherCore->dispatch() #5 {main} thrown in /home/mysite/public_html/tools/profiling/Controller.php on line 267

 

For my site, it is located in Singapore. I had tried to download a 100mb file. the speed is 1mb/s

here is the speed test.

http://www.speedtest.net/my-result/2928844463

Share this post


Link to post
Share on other sites

Can you send me ftp access to your shop through pm, and I will take a look at it.

Share this post


Link to post
Share on other sites

Dh42,

 

Thank you for your contributions to this thread and also for the many excellent articles on your website. It's all been very informative.

 

My question is about the Cloudflare performance tests. Cloudflare is not a push based CDN but a pull based CDN. The first time a site is accessed from a given geographic location Cloudflare has to pull all the content from the original site and then re-serve it to the visitor. Cloudflare then caches the static content for the period of time the site owner has set. Additional visitors from that region will get cached content until it expires. (I'm not sure how Cloudflare manages the expiration of data that is accessed regularly but I know it only serves cached data to the 2nd and subsequent visitors from a given geographic region.)

 

Therefore if your test was only hitting the target sites through Cloudflare once there would generally be little, if any, speed improvement. It wouldn't be surprising to actually see increased load times for the initial visitor due to additional overhead of going through Cloudflare for data that hasn't been cached yet. Since this is exactly what the test results show I am wondering if the tests hit the test server through Cloudflare one time or multiple times. (Of course to get a proper idea of speed the test computer's local cache needs to be cleared between tests.)

 

My own informal testing of a Cloudflare-enabled WordPress site has shown quite a dramatic speed increase for 2nd and subsequent visitors. The site is hosted on a WiredTree managed VPS and the informal tests were run from Osaka, Japan. Cached data was being served from Cloudflare's Tokyo servers.

 

Cheers from OSaka,

 

ncast

 

Edit: I was just looking through more of your website and I am unable to see the images on your portfolio page (http://dh42.com/portfolio/). Maybe it's just me, I'm not sure, but all I see are the little icons that come up when an image can't be loaded. I get the same thing when I try to view an individual site.

Edited by ncast (see edit history)

Share this post


Link to post
Share on other sites

I am familiar with how cloudflare works in relations to caching. I tried to load the caches by leaving the sites attached to cloudflare for about 24 hours before the tests. I also ran load impact on the sites which accesses all of the files multiple times. However cloudflare is really closed about what it takes for a resource to actually be cached, so I could not tell if a resource was actually being cached or not.

 

 

Interesting, I am going to look into the portfolio images, Is it still happening? 

Share this post


Link to post
Share on other sites

I am familiar with how cloudflare works in relations to caching. I tried to load the caches by leaving the sites attached to cloudflare for about 24 hours before the tests. I also ran load impact on the sites which accesses all of the files multiple times. However cloudflare is really closed about what it takes for a resource to actually be cached, so I could not tell if a resource was actually being cached or not.

 

Leaving otherwise-unused sites attached to CloudFlare doesn't result in any data being cached in my experience. Load impact tests should, but by default the data is only cached for 4 hours. If the load impact tests completed more than 4 hours before the performance tests were run the data wouldn't be cached.

 

Edit: Also, if the load impact tests are run from a different geographic location to the speed tests the speed tests will not find cached data. From what I have seen Cloudflare caches are not sync'd across their network, each geographic region has it's own cached data.

 

CloudFlare also only caches static content such as images and JavaScript. If a site is not graphic/JS heavy then there may not be much of a performance increase. The site I noticed the change with was very image-heavy while the default PrestaShop template front page isn't. This may also explain the differences in our experience.

 

 

Interesting, I am going to look into the portfolio images, Is it still happening? 

 

The main portfolio page (http://dh42.com/portfolio/) now loads correctly. However when I view individual portfolio site entries (eg http://dh42.com/maison-de-stencils/) the problem persists. The "View Site" links are also missing, there are no links to the sites. Site was viewed with Win8+Chrome 29, Win8+FF 23, and an iPad2 on iOS 6.1.2 with the same results.

Edited by ncast (see edit history)

Share this post


Link to post
Share on other sites
Guest
This topic is now closed to further replies.

×
×
  • Create New...

Important Information

Cookies ensure the smooth running of our services. Using these, you accept the use of cookies. Learn More