PDA

View Full Version : Cache


philja
31-03-07, 02:33
I see there is Cache directory, but how to activate it, so the pages will be saved in cache? Is it done or is it only for future use?

amarath
31-03-07, 11:23
Hi Phil,

Are you referring to the templates_c directory caching your pages?

If so, please refer to the document entitled 'ShopWindow Technical Specifications and Support (http://www.shopwindowforum.com/showthread.php?t=7)'.

Page 8 provides details on how to do this.

Thanks

Amo

philja
31-03-07, 22:03
I was talking about directory /include/smarty/cache

I thought that maybe ShopWindow Client can keep search results in cash locally (until it expire) => so the same requests will be read from local cache not from AffiliateWindow Server

I have checked the document entitled 'ShopWindow Technical Specifications and Support'.

And page 8 provides details on using setiing variable:

$force_compile

I have change value of $force_compile to true then to false, but
/include/smarty/cache is still empty.

So the local caching of results is not working for me.

Andy
01-04-07, 16:54
Doesn't work for me either. that variable is set to "false" by default.

Even chMod'ing the cache directory to 777 doesn't make any difference.

Andy
01-04-07, 21:26
Ok, Ive sussed this out

Make sure the "cache" directory is ChMod to 777

open includes/smarty/Smarty.class.php

Line 149
var $force_compile = false;
Make sure it is set to FALSE

Line 160
var $caching = 0;

change to
var $caching = 1;

and Viola!! we have smarty caching!! :D

Confuscius
01-04-07, 21:34
Thanks Andy. I see we can also set the cache time also!

Correction : open includes/smarty/libs/Smarty.class.php

Paul

ushop-online
01-04-07, 21:50
Yes seconded this works fine :)

Andy
01-04-07, 22:55
ahh yes, /libs/
My bad! Cheers for putting that right paul.
It does work though, ive seen a massive increase in speed

gunneradt
03-04-07, 00:59
brilliant - well done

gunner

Dinamo
06-04-07, 21:01
I was able to enable caching and I see it creating files in includes/smarty/cache.
However, the cached page does not appear to load any faster.

Also, I can see that it updates the timestamp of the cached file after every reload - is there a chance it writes cache, but does not read it?

Andy
07-04-07, 12:41
I was able to enable caching and I see it creating files in includes/smarty/cache.
However, the cached page does not appear to load any faster.

Also, I can see that it updates the timestamp of the cached file after every reload - is there a chance it writes cache, but does not read it?
I suppose that is a possibilty.
Untested:
After it has cached the output, try this:
open includes/smarty/Smarty.class.php

Line 149
Code:

var $force_compile = true;

Make sure it is set to true

That line seems to force the cache compilation if set to FALSE, so once you have cache, set it to true and see if that forces the system to read the cache instead of recompiling it.

karsin
12-04-07, 06:48
Hi, Andy,

I'm confused, earlier you asked to set
var $force_compile = false;
and last reply you suggested
var $force_compile = true;

I have tried both, it still updates my timestamp :(

help~

Andy
12-04-07, 10:54
Hi, Andy,

I'm confused, earlier you asked to set
var $force_compile = false;
and last reply you suggested
var $force_compile = true;

I have tried both, it still updates my timestamp :(

help~
Like I said, it was untested.
When $force_compile is set to false, it definately caches, so i suggested setting it to true to see if it stops cacheing. But obviously it doesn't

karsin
14-04-07, 12:53
in class.smarty_sw.php

look for the last line

// force compile on every load, disable once live
$this->force_compile= true;

I think we have to comment it when go live. else it will somehow overriding the force_compile in the includes/lib/Smarty.class.php

Now the caching is reading from cache folder.

crounauer
19-04-07, 12:26
Hello,

I have managed to get the cache facility working but once the first page has been cached it always goes back to that page no matter which other page is called/requested.

Is this because I am using PHP 4.3 and not PHP 5?

Any suggestions would be greatful!

Regards,
Simon

the-ferret
10-08-07, 11:59
Hello,

I have managed to get the cache facility working but once the first page has been cached it always goes back to that page no matter which other page is called/requested.

Is this because I am using PHP 4.3 and not PHP 5?

Any suggestions would be greatful!

Regards,
Simon

I get the same result, looks like the search result is cached and always called. Does anyone know how this can be overcome?

crounauer
10-08-07, 12:11
Hi,

I ended up upgarding to PHP 5 and everything came right. I did notice that this script is intended for PHP 5 only which is why there is no support for any previous PHP versions.

I would suggest an upgrade to PHP 5?

Regards,
Simon