Post by Rhyell » Sat Feb 16, 2013 3:33 pm

I am having image cache issues with Version 1.5.5.1

In my config file I have set up the image location:
define('HTTP_IMAGE', 'http://static.mydomain.co.uk/image/');
define('DIR_IMAGE', '/var/sites/c/mydomain.co.uk/subdomains/static/image/');

and the domain location:
define('HTTP_CATALOG', 'http://www.mydomain.co.uk/');

This previously worked ok on version 1.5.4.1 but now in the admin panel>Products the image cache location refers to:
http://www.mydomain.co.uk/image/cache/data/
and not
http://static.mydomain.co.uk/image/cache/data/

The front end works perfectly even though the images in the backend do not.

Any help appreciated.

New member

Posts

Joined
Mon Jan 14, 2013 7:48 pm

Post by seoadsem » Sat Feb 16, 2013 6:34 pm

Same problem on my side, just that it doesn't work for both, backend and front-end. It is referring for all to /image/cache/data/ instead of sub-domain.
I also tried for the default store, installed in on a separate domain, and same thing, doesn't work anymore for 1.5.5.1 to add sub-domain to paralelize downloads across different host-names.
Also noticed that the config file changed a bit:

Code: Select all

// HTTP
define('HTTP_SERVER', 'http://www.testingcom.tk/');
define('HTTP_IMAGE', 'http://static.testingcom.tk/');
// HTTPS
define('HTTPS_SERVER', 'http://www.testingcom.tk/');
define('HTTPS_IMAGE', 'http://static.testingcom.tk/');

define('DIR_IMAGE', '/home/user/domains/www.testingcom.tk/static/');
There is only one variable for HTTP and HTTPS, the second one i added it myself.

Newbie

Posts

Joined
Mon Aug 27, 2012 1:50 am

Post by Rhyell » Sat Feb 16, 2013 11:28 pm

I really need some input from a Guru here...

Anyone know about this issue?

New member

Posts

Joined
Mon Jan 14, 2013 7:48 pm

Post by ADD Creative » Mon Feb 18, 2013 5:46 pm

This looks like a intentional change.

https://github.com/opencart/opencart/co ... 965f89decf

You may be able to undo it by looking at that.

www.add-creative.co.uk


Active Member

Posts

Joined
Sat Jan 14, 2012 1:02 am
Location - United Kingdom

Post by Rhyell » Mon Feb 18, 2013 6:41 pm

@ADD Creative

You pointed me in the right direction... Sort of...

After looking at the code I discovered that the CATALOG Definition in the admin config file was now pointing to the wrong place after the upgrade to Version 1.5.5.1:

Change:

Code: Select all

define('HTTP_CATALOG', 'http://www.mydomain.co.uk/');
To:

Code: Select all

define('HTTP_CATALOG', 'http://static.mydomain.co.uk/');
I re-defined the DIR under the Admin Config file:

Code: Select all

define('DIR_IMAGE', '/var/sites/c/mydomain.co.uk/subdomains/static/image/');
define('DIR_CATALOG', '/var/sites/c/mydomain.co.uk/subdomains/static/catalog/');
Everything works OK now and content can be pulled in form a static domain.

I hope this helps people out there?

Cheers

New member

Posts

Joined
Mon Jan 14, 2013 7:48 pm

Post by Rhyell » Mon Feb 18, 2013 7:38 pm

Whilst this does fix the product images cache. When you click on "Store Front" from within the admin panel you are directed to:

Code: Select all

http://www.static.mydomain.co.uk
Something else needs to be looked at.... Fast!

New member

Posts

Joined
Mon Jan 14, 2013 7:48 pm

Post by ADD Creative » Tue Feb 19, 2013 1:47 am

There are a few places where replacing:

Code: Select all

$this->config->get('config_ssl') . 'image/'
with

Code: Select all

HTTPS_IMAGE
and

Code: Select all

$this->config->get('config_url') . 'image/'
with

Code: Select all

HTTP_IMAGE
will put back to using HTTP_IMAGE and HTTPS_IMAGE from your config.

But there is also

Code: Select all

$server . 'image/'
in catalog\controller\common\header.php which will need putting back to HTTPS_IMAGE or HTTP_IMAGE. Look how this was done in 1.5.4.1.

There may be a few other places where HTTPS_IMAGE or HTTP_IMAGE need putting back in the code. Search for them in 1.5.4.1 and find the same place in 1.5.5.1 and change the code accordingly.

www.add-creative.co.uk


Active Member

Posts

Joined
Sat Jan 14, 2012 1:02 am
Location - United Kingdom

Post by Rhyell » Tue Feb 19, 2013 3:10 am

Thanks for the advice, but we shouldn't really have to do this. At least I can get up and running again.

New member

Posts

Joined
Mon Jan 14, 2013 7:48 pm

Post by seoadsem » Wed Feb 20, 2013 3:17 am

The final fix had been attached. Indeed Adcreative was right.
After that you don't need to modify catalog var, you need to add
In admin config:
define('HTTP_IMAGE', 'http://img.domain.com/');
define('HTTPS_IMAGE', 'http://img.domain.com/');

define('DIR_IMAGE', '/home/user/public_html/www.domain.com/static/');

This is in case you added the entire image folder on the sub-domain, not sub-domain of sub-folder.
If it is sub-domain of sub-foler than also add the folder

define('HTTP_IMAGE', 'http://static.domain.com/image/');
define('HTTPS_IMAGE', 'http://static.domain.com/image/');

define('DIR_IMAGE', '/home/user/public_html/www.domain.com/static/image/');

Thanks again both: Adcreative and Rhyell.

Newbie

Posts

Joined
Mon Aug 27, 2012 1:50 am

Post by Stergios » Tue Jul 07, 2015 3:17 pm

Hello, I know this topic is for 1.5x but I am trying to figure this out days... without success.
I am using 2.0.1.1, I did everything as described, the vqmod's alters are the same for 2x, the image path is successfully change to subdomain which is looking right but the products on the store are broken (not found).
So while you figure this out on 1.5x, there's must be something more to have to alter on 2x to make this work.
Any ideas?

New member

Posts

Joined
Sat Apr 12, 2014 1:11 am

Post by ADD Creative » Tue Jul 07, 2015 6:17 pm

View the source in a web browser of a page where the image is not showing and check the img tag src is actually correct. If it not correct try and work out where it's wrong.

www.add-creative.co.uk


Active Member

Posts

Joined
Sat Jan 14, 2012 1:02 am
Location - United Kingdom

Post by Stergios » Wed Jul 08, 2015 12:07 am

Thanks for reply. I have solve this. The issue was cloudflare, I had to add subdomain to the records, thanks

New member

Posts

Joined
Sat Apr 12, 2014 1:11 am
Who is online

Users browsing this forum: No registered users and 36 guests