page cache and php

Post Reply
erosmembers
Posts: 97
Joined: Tue Mar 15, 2016 9:41 pm

page cache and php

Post 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.
admin
Site Admin
Posts: 38004
Joined: Wed Sep 10, 2008 11:43 am

Re: page cache and php

Post by admin »

Yes, you can use PHP code in templates.
It is not cached.
So you code will be executed at each page load.
Don't forget to run script update
erosmembers
Posts: 97
Joined: Tue Mar 15, 2016 9:41 pm

Re: page cache and php

Post 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.
admin
Site Admin
Posts: 38004
Joined: Wed Sep 10, 2008 11:43 am

Re: page cache and php

Post 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.
Don't forget to run script update
Post Reply