PHP Cache MCQs
PHP Cache MCQs : This section focuses on "Cache" in PHP. These Multiple Choice Questions (mcqs) should be practiced to improve the PHP skills required for various interviews (campus interview, walk-in interview, company interview), placements, entrance exams and other competitive examinations.
1. In PHP, caching is used to ________ page generation time.
A. maximize
B. minimize
C. full
D. remove
View Answer
Ans : B
Explanation: In PHP, caching is used to minimize page generation time.
2. A cache is a collection of duplicate data, where the original data is expensive to fetch or compute (usually in terms of access time) relative to the cache.
A. TRUE
B. FALSE
C. Can be true or false
D. None of the above
View Answer
Ans : A
Explanation: True, A cache is a collection of duplicate data, where the original data is expensive to fetch or compute (usually in terms of access time) relative to the cache.
3. Session cache is used to?
A. Restart the script
B. empty the temporary var/cache files
C. Empty the navigator cookies
D. All of the above
View Answer
Ans : C
Explanation: Session cache Empty the navigator cookies
4. Which of the following is used to restart the script ?
A. Navigator cache
B. Instance cache
C. Framework cache
D. ORM cache
View Answer
Ans : B
Explanation: Instance cache is used to restart the script.
5. How many main types of caching is there?
A. 2
B. 3
C. 4
D. 5
View Answer
Ans : A
Explanation: PHP basically has two main types of caching: output caching and parser caching.
6. PHP output caching saves a chunk of data somewhere that can later be read by another script faster than it can generate it.
A. TRUE
B. FALSE
C. Can be true or false
D. None of the above
View Answer
Ans : A
Explanation: True, PHP output caching saves a chunk of data somewhere that can later be read by another script faster than it can generate it.
7. Which of the following caching mechanisms is typically used in PHP for storing data on the server side?
A. Browser caching
B. Memcached
C. Client-side caching
D. Page caching
View Answer
Ans : B
Explanation: Memcached caching mechanisms is typically used in PHP for storing data on the server side
8. Which of the following extension is commonly used for opcode caching?
A. APC
B. Memcached
C. XCache
D. Redis
View Answer
Ans : A
Explanation: Alternative PHP Cache is commonly used for opcode caching
9. _________ directive in the php.ini file is used to enable opcode caching in PHP.
A. opcode_cache.enable
B. apc.enable
C. opcache.enable
D. None of the above
View Answer
Ans : C
Explanation: opcache.enable directive in the php.ini file is used to enable opcode caching in PHP.
10. Which function is commonly used to store data in a cache?
A. cache_set()
B. set_cache()
C. cache_store()
D. None of the above
View Answer
Ans : D
Explanation: None of the above
Also check :
Discussion