General Guide: See Global LCP Guide for universal concepts and fixes.
What is LCP?
Largest Contentful Paint measures when the largest content element becomes visible. Google recommends LCP under 2.5 seconds. GetSimple CMS is an ultra-lightweight flat-file CMS using XML for storage and PHP templates for rendering. Its simplicity is an advantage for LCP, but common pitfalls exist.
GetSimple-Specific LCP Causes
- No built-in caching -- GetSimple parses XML files and renders PHP templates on every request without any page cache
- Unoptimized theme images -- images uploaded via the file manager serve at original resolution with no processing
- Plugin overhead -- GetSimple plugins (I18N, Multi-User, GetSimple Gallery) inject scripts and styles globally
- Shared hosting PHP -- GetSimple is frequently deployed on budget hosting with slow PHP execution
- Theme CSS loaded synchronously -- theme stylesheets block rendering until fully downloaded
Fixes
1. Implement Page Caching
GetSimple has no built-in cache. Add one via a plugin or manual implementation:
<?php
// Create a simple full-page cache
// Add to the top of your theme's template.php
$cacheDir = GSDATAOTHERPATH . 'cache/';
$cacheFile = $cacheDir . md5($_SERVER['REQUEST_URI']) . '.html';
$cacheTTL = 3600; // 1 hour
if (file_exists($cacheFile) && (time() - filemtime($cacheFile) < $cacheTTL)) {
readfile($cacheFile);
exit;
}
ob_start();
// ... rest of your template renders here
// At the end of the template:
$output = ob_get_contents();
if (!is_dir($cacheDir)) mkdir($cacheDir, 0755, true);
file_put_contents($cacheFile, $output);
?>
Or use the gs-caching plugin from the GetSimple Extend repository.
2. Optimize Image Loading
GetSimple stores uploads in data/uploads/. Add responsive images to your theme:
<!-- In your theme's template.php -->
<?php if (get_page_meta_image()): ?>
<img
src="<?php get_page_meta_image(); ?>"
width="1200" height="630"
alt="<?php get_page_clean_title(); ?>"
loading="eager"
fetchpriority="high"
style="aspect-ratio: 1200/630; width: 100%; height: auto; object-fit: cover;"
>
<?php endif; ?>
Optimize images server-side:
# Optimize all uploads
find data/uploads/ -name "*.jpg" -exec mogrify -strip -quality 80 -resize "1920>" {} \;
find data/uploads/ -name "*.png" -exec optipng -o2 {} \;
3. Inline Critical CSS
GetSimple themes load CSS via <?php get_header(); ?>. Add critical CSS before it:
<!-- In theme/YOURTHEME/template.php -->
<head>
<style>
/* Critical above-fold CSS */
body { font-family: system-ui, sans-serif; margin: 0; }
.header { display: flex; height: 64px; align-items: center; }
.hero { width: 100%; aspect-ratio: 16/9; }
.content { max-width: 800px; margin: 0 auto; padding: 1rem; }
</style>
<!-- Defer full theme CSS -->
<link rel="preload" href="<?php get_theme_url(); ?>/style.css" as="style"
<noscript>
<link rel="stylesheet" href="<?php get_theme_url(); ?>/style.css">
</noscript>
<?php get_header(); ?>
</head>
4. Minimize Plugin Loading
Audit active plugins at Admin > Plugins. Deactivate unused ones. For needed plugins:
<!-- Conditionally load plugin assets only on pages that need them -->
<?php if (get_page_slug() === 'gallery'): ?>
<!-- Gallery plugin CSS/JS only on gallery page -->
<?php get_component('gallery_styles'); ?>
<?php endif; ?>
5. Add .htaccess Caching Headers
# .htaccess
<IfModule mod_expires.c>
ExpiresActive On
ExpiresByType image/jpeg "access plus 1 year"
ExpiresByType image/png "access plus 1 year"
ExpiresByType image/webp "access plus 1 year"
ExpiresByType text/css "access plus 1 month"
ExpiresByType application/javascript "access plus 1 month"
</IfModule>
<IfModule mod_deflate.c>
AddOutputFilterByType DEFLATE text/html text/css application/javascript
</IfModule>
Measuring LCP on GetSimple
- PageSpeed Insights -- primary tool since GetSimple has no built-in performance monitoring
- TTFB check --
curl -w "TTFB: %{time_starttransfer}\n" -o /dev/null -s https://yoursite.com-- if over 500ms, focus on caching - Test with plugins disabled -- disable all plugins to see baseline LCP
- Since GetSimple is flat-file with few pages, there is no query optimization to do -- focus on caching and asset delivery
Analytics Script Impact
GetSimple analytics is typically added manually to theme templates:
- Place
<script async>tags at the bottom oftemplate.phpbefore</body> - Avoid
document.write()analytics snippets - GetSimple's built-in visitor tracking (if any) is minimal