Blog Sections Open

Giving phpThumb Preview Files Readable SEO-Friendly Names

A practical image-generation tweak for teams that want cache thumbnails to use readable filenames instead of opaque hashes.

Generated thumbnails often end up with opaque hash-based filenames. That is technically fine for caching, but it can be unpleasant for debugging, media audits, and some SEO-conscious workflows.

The legacy idea

The donor solution modified the thumbnail generation logic so a cached preview could use a readable name based on the source filename and resize parameters instead of only a long MD5 string.

$outputFilename = $_SERVER['DOCUMENT_ROOT'] . '/assets/cache/phpthumbof/'
. $path_parts['filename'] . '_w' . $op['w'] . '-h' . $op['h'] . '.' . $op['f'];

Why teams liked this

  • preview files are easier to inspect on disk
  • cache directories become more understandable
  • debugging image issues gets faster

Caution

Readable naming only works well if the generated filename still stays unique for every transformation set. Width, height, format, and any other critical options must be represented or safely hashed, otherwise files will overwrite each other.

This is not a universal SEO requirement, but for some legacy workflows it is a useful quality-of-life improvement.

Newer post

When Strict URLs Becomes a Performance Bottleneck

A performance cautionary note for large catalogs where URL normalization plugins can become unexpectedly expensive during page generation.

Older post

Understanding the index-ajax.php LFI Risk in Legacy Evolution CMS

A security-oriented legacy note on why index-ajax.php was risky, how local file inclusion could happen, and why inherited projects should review this area carefully.