0

Looking at creating my first web application using php and an opcode cache.

I vaguely understand why it's beneficial in theory.

However, in practice - how does apc work with opcodes compiled from session specific variables? If one page (say somesharedpage.php) is cached, how are variables within (that may be different for every user) treated and handled?

1 Answer 1

3

Simply, APC works with code and not data, because data doesn't contain any opcodes.

When should data be added to apc?

Data that you would want to cache using apc_fetch(), apd_store() etc. are ideally values that would take some processing time to get generated, rather than simply "all my globals".

Sign up to request clarification or add additional context in comments.

2 Comments

Are files automatically added to the apc simply by adding it to php and enabling it? When should data be added to apc? Only for global variables? Or static variables I should say (that won't change). And by data I mean arrays, strings, etc that are to be accessed using apc_fetch and apc_store
Files would automatically get added to APC upon execution (or rather, just before) or when code is include()ed. Updated answer.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.