Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

Template Questions /

Moderators: martimiz, Sean, Ed, biapar, Willr, Ingo, swaiba

has partial caching become buggy?


Go to End


17 Posts   5744 Views

Avatar
Devlin

Community Member, 344 Posts

30 June 2015 at 9:14pm

Edited: 30/06/2015 9:20pm

If I use your example and refresh the page, both dates stay the same. I tried it too on a fresh 3.1.13 install.

The only way I can reproduce your issue is, if I invalidate caching in the config.

SS_Cache::set_cache_lifetime('any', -1);

edit: ... or if I append a ?flush to the url

Avatar
ee

Community Member, 7 Posts

30 June 2015 at 9:44pm

Edited: 30/06/2015 9:45pm

Ok, I have got it working!

I'm not very technical but will try to explain:

Originally I was developing with the files on my windows machine with XAMPP with the database on a linux server. This is how we usually work in our office, as the files are kept on github. This is when partial caching was not working

As a last resort I moved the files onto the linux server and partial caching is now working. I don't know why it is working though!

Avatar
mikeyc7m

Community Member, 19 Posts

30 July 2015 at 1:23pm

Edited: 30/07/2015 1:40pm

i have hit this problem again. perhaps it's a setting on my wamp? does anyone know what php/apache/mysql settings are required for ss partial caching to work?

Avatar
innoweb

Community Member, 9 Posts

4 December 2015 at 5:56pm

Hi Michael,

Have you ever been able to fix this issue? I just ran into this myself, using XAMPP and SS 3.1.16.
When I use

<% cached %>

it works, but as soon as I insert a key like
<% cached $LastEdited %>

or
<% cached 'bla' %>

it doesn't.

Avatar
mikeyc7m

Community Member, 19 Posts

7 December 2015 at 6:43pm

Nope, never solved it. It seems to be a php/apache setting, unrelated to the SS core. Website code that won't cache on my local machine will cache fine on the remote server.

Avatar
martimiz

Forum Moderator, 1391 Posts

7 December 2015 at 9:49pm

Have you checked SilverStripe issues on Github for this? If it hasn't been reported, I think the only way to try and tackle this is first take inventory of the enviroment - apache version, php version, MAMP/WAMP, SilverStripe version. As you're on your local machine, try a fresh default install of the server stack, a fresh install of SilverStripe and take it from there...

If it still occurs, you still cannot be sure it is actually a SilverStripe bug but it may be worth to report it as a SilverStripe issue on GitHub...

Avatar
innoweb

Community Member, 9 Posts

8 December 2015 at 11:53am

Thank you martimiz.

I have opened an issue on github: https://github.com/silverstripe/silverstripe-framework/issues/4832

While testing I found out that if you create the silverstripe-cache directory in the root of the project and rebuild the cache the partial caching works fine. I wonder why that is...

Avatar
martimiz

Forum Moderator, 1391 Posts

8 December 2015 at 10:59pm

Well, that's an easy solution :)

Might have something to do with the way your default temp directory is set up. I tend to always use the silverstripe-cache in the site root, because It gives me more control, I can easily clear it, if things look whacky, and also I don't want the caches of all those hundreds of testsites I have set up on my local machine during time keep polluting my temp directory :)

i