Page 1 of 1
page cache and php
Posted: Sun Apr 03, 2016 10:39 pm
by erosmembers
I think that I can include php code in templates.
Or am I wrong?
But how does it affect page cache?
Please could you give us an example and an explanation:
e.g. a little bit php code to check a parameter and to include some javascript.
Re: page cache and php
Posted: Mon Apr 04, 2016 4:48 am
by admin
Yes, you can use PHP code in templates.
It is not cached.
So you code will be executed at each page load.
Re: page cache and php
Posted: Mon Apr 04, 2016 6:01 am
by erosmembers
All other parts of pafge is stored in cache?
Do you have an example, how much pageload time will it take with PHP and without PHP?
Lets say we have only some lines of PHP code that will do only a comparison.
Re: page cache and php
Posted: Mon Apr 04, 2016 6:14 am
by admin
If "other parts" means html then yes.
"how much pageload time will it take with PHP and without PHP?"
There's no way I can say how much unknown PHP code will affect pageload time.
But you test test it by yourself - just add and remove the code and see the difference.