Chevereto is an image and video hosting script that gets heavier the moment your library grows past a few thousand uploads. A gallery page that loads instantly with 200 images can crawl once you cross tens of thousands, because every request touches PHP, hits the database for image metadata, and generates or serves multiple thumbnail sizes. On a Managed Cloud Shared Hosting account you cannot rebuild the server, but you can control almost everything that actually causes the slowdown: how PHP compiles code, where sessions and cache data live, how static assets are delivered, and how much work the application does per request.

Before changing anything, work out where the time is going. Open your browser developer tools (F12), load a slow gallery page, and watch the Network tab. If the initial HTML document (the document request) takes several seconds while images load quickly afterward, your bottleneck is PHP and the database. If the document returns fast but dozens of thumbnails trickle in slowly, the problem is image delivery and connection concurrency. Chevereto also writes to a local error_log inside your document root and to the log viewer in cPanel (Metrics > Errors); repeated warnings about memory, GD, or slow queries there tell you exactly which subsystem is struggling.

PHP version and OPcache: compiling code only once

Chevereto is a PHP-heavy application, and the single most effective change on shared hosting is making sure PHP compiles its scripts once and reuses the compiled bytecode. Without OPcache, every request re-parses thousands of PHP files from disk. Start by confirming your PHP version in cPanel Jupiter under MultiPHP Manager, or in DirectAdmin Evolution under Select PHP Version. Current Chevereto releases run best on PHP 8.1 or 8.2. Older PHP 7.x builds are both slower and increasingly unsupported by the application, so moving up is usually the cheapest performance win available.

With the version set, open the PHP extension list. In cPanel this is Select PHP Version > Extensions (CloudLinux PHP Selector); in DirectAdmin it is the same PHP Selector panel. Confirm that opcache is enabled, along with gd or imagick (Chevereto needs one of these for thumbnails), curl, mbstring, and fileinfo. Then move to PHP Options (the Options tab in PHP Selector) and raise the values that Chevereto genuinely needs. Reasonable shared-hosting targets are memory_limit of 256M, max_execution_time of 120, upload_max_filesize and post_max_size of 64M or higher if you accept large uploads, and OPcache settings of opcache.enable=1, opcache.memory_consumption=192, and opcache.max_accelerated_files=20000 because Chevereto ships a large file tree.

If your PHP Selector does not expose every directive, set them yourself with a .user.ini file placed in your document root (typically /home/username/public_html/.user.ini). A minimal file looks like this:

memory_limit = 256M
max_execution_time = 120
upload_max_filesize = 64M
post_max_size = 64M
opcache.enable = 1
opcache.memory_consumption = 192
opcache.max_accelerated_files = 20000
opcache.revalidate_freq = 60

Changes to .user.ini apply after the configured cache TTL (often 300 seconds) or after the PHP worker recycles. Load a page and check phpinfo or the Chevereto dashboard system panel to confirm the new limits took effect. The approach mirrors what we describe for other PHP apps in CodeIgniter performance tuning on shared hosting, and the OPcache principles carry over directly.

Redis for object and session caching

Chevereto supports an external cache backend, and on hosting where Redis is available it removes a large amount of repeated database work. Every gallery page normally re-reads settings, category data, and session state from MySQL. Pointing that traffic to Redis keeps it in memory and shortens the document response time you measured earlier.

First confirm Redis exists on your account. In cPanel, look for a Redis icon or check Select PHP Version > Extensions for redis; in DirectAdmin, check the PHP Selector extension list. If the extension is present and a Redis instance is provisioned for your user, note the socket path or host and port your provider assigned (shared hosting almost always uses a per-user socket or a localhost port with a password). Then edit Chevereto's configuration. Open File Manager, navigate to /home/username/public_html/app/, and edit env.php. Add or adjust the cache block:

'cache' => [
    'driver' => 'redis',
    'host' => '127.0.0.1',
    'port' => 6379,
    'password' => 'your-redis-password',
    'database' => 0,
],

If your host uses a Unix socket instead, set 'host' to the socket path (for example /home/username/.redis/redis.sock) and leave the port blank as your provider documents. After saving, reload the Chevereto dashboard and open Settings > System to verify the cache backend reports as active. Watch your local error_log for connection refusals; a failed Redis connection can make pages slower than no cache at all, so if you see repeated errors, revert the driver to auto or file until the credentials are confirmed. When Redis is unavailable, the file cache still helps and requires no external service.

LiteSpeed delivery, .htaccess caching, and static assets

Your account runs on LiteSpeed Web Server, which reads Apache-style rules but serves static files far faster than PHP ever will. The images and thumbnails Chevereto produces are static, so the goal is to let LiteSpeed serve and cache them with long expiry headers while never letting PHP touch them a second time. Add browser-cache and compression rules to the .htaccess in your document root, below the existing Chevereto rewrite block (never remove Chevereto's own rewrite rules):

<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 image/gif "access plus 1 year"
  ExpiresByType text/css "access plus 1 month"
  ExpiresByType application/javascript "access plus 1 month"
</IfModule>

<IfModule LiteSpeed>
  CacheLookup on
</IfModule>

<IfModule mod_deflate.c>
  AddOutputFilterByType DEFLATE text/html text/css application/javascript application/json image/svg+xml
</IfModule>

LiteSpeed compresses text responses automatically, but the explicit expiry headers stop browsers from re-requesting images that never change, which is the fastest way to cut repeat-visit load times. Inside Chevereto itself, open Dashboard > Settings > Image and review your thumbnail configuration. Generating multiple large thumbnail dimensions on every upload consumes CPU and disk; trim the sizes you actually display in your theme. If your account and Chevereto license support it, enable WebP output so browsers download smaller files. Under Settings > Performance (available in recent versions), enable HTML minification and asset concatenation to reduce the number of round trips per page.

Two structural choices matter for large libraries. Serving originals only when a user explicitly opens full size, rather than on gallery grids, prevents multi-megabyte downloads during browsing. And if slow document responses persist after OPcache and Redis are in place, use phpMyAdmin (cPanel > Databases > phpMyAdmin) to inspect the Chevereto tables: confirm the chv_images table has its default indexes intact after any migration, since a missing index on a table with hundreds of thousands of rows turns every listing query into a full scan. You cannot tune server-wide MySQL variables on shared hosting, but keeping indexes healthy and pruning abandoned guest uploads keeps query times low. Measure after each change with the Network tab so you know which adjustment moved the number, rather than stacking settings blindly.