Drupal Drupal Performance & Security 1 — Questions and Answers
Question 1: Which Drupal core module caches fully rendered pages for anonymous users to reduce server load?
- Dynamic Page Cache
- Internal Page Cache (Correct answer)
- BigPipe
- Render Cache
Correct answer: Internal Page Cache
The Internal Page Cache module caches rendered pages for anonymous users, serving subsequent requests directly from cache without bootstrapping Drupal fully.
Question 2: What does Drupal's BigPipe module primarily accomplish?
- Compresses CSS and JavaScript files into a single bundle
- Caches all database queries in memory
- Streams cacheable page parts immediately while lazy-loading uncacheable placeholders (Correct answer)
- Minifies HTML output before delivery
Correct answer: Streams cacheable page parts immediately while lazy-loading uncacheable placeholders
BigPipe improves perceived performance by streaming the cacheable portions of a page to the browser first, then filling in non-cacheable placeholders asynchronously.
Question 3: What does enabling 'CSS Preprocessing' in Drupal's Performance settings do?
- Combines multiple CSS files into fewer aggregated files to reduce HTTP requests (Correct answer)
- Minifies CSS by removing whitespace and comments
- Converts CSS variables to static values for browser compatibility
- Moves all CSS loading to the bottom of the page body
Correct answer: Combines multiple CSS files into fewer aggregated files to reduce HTTP requests
CSS Preprocessing aggregates multiple CSS files into a smaller number of combined files, reducing the number of HTTP requests needed to load a page.
Question 4: What is the purpose of Drupal's cache tags system when integrating with a reverse proxy like Varnish?
- Tags restrict which users can access cached content
- Tags allow granular cache invalidation so only affected pages are purged when content changes (Correct answer)
- Tags identify which cache backend should store each cache entry
- Tags set the time-to-live for cached entries in the proxy
Correct answer: Tags allow granular cache invalidation so only affected pages are purged when content changes
Cache tags allow Drupal to tell reverse proxies exactly which cached pages contain a specific piece of content, enabling precise invalidation when that content is updated.
Question 5: What does a cache max-age of 0 signify in Drupal's cacheability metadata?
- The element should be cached indefinitely
- The element is not cacheable and must always be rendered fresh (Correct answer)
- The element expires immediately after the first request
- The element uses the site's default cache lifetime
Correct answer: The element is not cacheable and must always be rendered fresh
A max-age of 0 marks a render element as not cacheable, instructing Drupal's caching system to never store or reuse that element.
Question 6: Which approach allows Drupal to store cache data in fast in-memory storage instead of the database?
- Enabling the Entity Cache module from core
- Integrating contributed modules like Memcache or Redis Cache as alternate cache backends (Correct answer)
- Using the Internal Page Cache with the 'memory' storage option
- Configuring PHP's opcache to intercept Drupal cache reads
Correct answer: Integrating contributed modules like Memcache or Redis Cache as alternate cache backends
Contributed modules such as Memcache and Redis Cache replace Drupal's default database cache backend with fast in-memory stores, significantly reducing cache read/write latency.
Question 7: What does enabling JavaScript aggregation in Drupal's Performance settings accomplish?
- Defers all JavaScript execution until after the page is fully rendered
- Combines multiple JS files into fewer files to reduce the number of HTTP requests (Correct answer)
- Minifies JavaScript by removing variable names and comments
- Moves all script tags from the head to the page footer
Correct answer: Combines multiple JS files into fewer files to reduce the number of HTTP requests
JavaScript aggregation merges multiple JS files into a smaller set of combined files, reducing the HTTP request overhead needed to load all scripts on a page.
Which Drupal core module caches fully rendered pages for anonymous users to reduce server load?