Php photo gallery TWG | JFUploader | TWG Flash upload | WFU | Forum
https://www.tinywebgallery.com/forum/

TWG1.9 and different cache directory
https://www.tinywebgallery.com/forum/viewtopic.php?f=5&t=3592
Page 1 of 1

Author:  wwi [ 30. Sep 2013, 22:07 ]
Post subject:  TWG1.9 and different cache directory

Hi there,

I have a new installation of TWG 1.9 where I moved the cache directory off the main directory (I do not want to backup the cache).

my_config.php therefore contains the entry
Code:
$cachedir="../cache";


and an
Code:
Alias /cache/ /srv/www/cache/

entry in the apache configuration.

However, I see error messages such as
Code:
[client aaa.bbb.ccc.ddd] File does not exist: /srv/www/cache/7e8f869c7f1565043222784344024ffc.css, referer: http://my.domain.tld



I assume there's a leftover piece of code that does not respect the cachedir setting? Where may I change this link?

Regards,
Arne

Author:  TinyWebGallery [ 30. Sep 2013, 22:30 ]
Post subject:  Re: TWG1.9 and different cache directory

This is where I create the optimized css which is stored than in the cache dir.
Does the file exist and is not found or not created at all?

What is the setting of $optimize_css?
Try to set this to false and retry and tell me if the error is gone on your system.

Is the cahce and the twg dir than parallel to each other?
And the alias should not be needed.

Best, Michael

Author:  wwi [ 2. Oct 2013, 23:08 ]
Post subject:  Re: TWG1.9 and different cache directory

Hi Michael,

I did not change $optimized_css - this is still set to "true" in config.php.

The cache directory is located outside the webserver root, i.e. the directory layout is as follows:
/srv/www/htdocs
/srv/www/htdocs/addons
/srv/www/htdocs/admin
[...]
and
/srv/www/cache

Since the new cache directory is outside the website tree (on the same level as "htdocs"), the alias is necessary so that apache finds the files. All thumbnails and some temporary PHP files are correctly generated there, and are found by the gallery. The .css file, however, is created in the old cache directory at /srv/www/htdocs/cache instead of /srv/www/cache - and therefore is not found, because the former is hidden by the Apache alias setting.
If I set $optimize_css to false, it works. It also works if I use another name for the new cache directory, e.g. /srv/www/newcache. In this case, there are effectively two cache directories in use, and it works because the old name is not hidden anymore by the new name. But the optimized css generation code should evaluate the $cachedir setting as the thumbnail generator already does.

BTW, the installation check seems to not respect the $cachedir setting as well. It only reads out the permissions of the "cache" subdirectory within the TWG tree, but not that of the directory referenced by $cachedir.


Regards, Arne

Author:  TinyWebGallery [ 4. Oct 2013, 21:20 ]
Post subject:  Re: TWG1.9 and different cache directory

o.k. I'll try this setup and let you know...

Meanwhile I hope you can live with css not optimized.

Best, Michael

Author:  wwi [ 7. Oct 2013, 23:09 ]
Post subject:  Re: TWG1.9 and different cache directory

Sure, no problem here. My website does not have that many visitors that I cannot live without optimization.

Thanks for great work!

Arne

Author:  TinyWebGallery [ 19. Nov 2013, 11:53 ]
Post subject:  Re: TWG1.9 and different cache directory

I have fixed this in TWG 2.0 which will be released soon...

Page 1 of 1 All times are UTC + 1 hour [ DST ]
Powered by phpBB® Forum Software © phpBB Group
http://www.phpbb.com/