Please upgrade here. These earlier versions are no longer being updated and have security issues.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.

Image optimization plugin for faster page load speed.

ProsperProsper ✭✭
edited December 2015 in Vanilla 2.0 - 2.8

Is there any image optimization plugin for vanilla forum that can meticoloudly scan all uploaded images and cut down unnecessary bytes making images and webpages load faster?
Example of this plugin for word press is "WP SMUSH" - URL is

Can this plugin be developed for vanilla forum?


  • vrijvlindervrijvlinder Papillon-Sauvage MVP
    edited December 2015

    You can do that already by reducing the allowed upload amount. So people do not upload huge files.
    Generally that is the purpose for using thumbnails. If you insert an image into the post instead of just having the thumbnail, it will affect the loading of the page. Reducing the amount of comments and discussions from each page, speeds up loading in general.

    $Configuration['Garden']['Upload']['MaxFileSize']= '1M';
    $Configuration['Garden']['Upload']['AllowedFileExtensions']     = array('txt','jpg','jpeg','gif','png', 'bmp', 'tiff', 'ico', 'zip','gz','tar.gz','tgz','psd','ai','fla','swf','pdf','doc','xls','ppt','docx','xlsx','log','rar','7z');
    $Configuration['Garden']['Picture']['MaxHeight'] = 600;
    $Configuration['Garden']['Picture']['MaxWidth']  = 300;
  • vrijvlindervrijvlinder Papillon-Sauvage MVP

    You could also have your users compress their images before uploading

  • @vrijvlinder - Thank you for your comments. I have actually setup max image size and dimensions to upload on config.php
    However, uploaded images that passes image size and dimensions requirement still need optimization. Is there a way of using an API from an image optimization service to scan and optimize all upload images on vanilla forum. That way, forum users can upload images without slowing down website speed.

  • hgtonighthgtonight ∞ · New Moderator

    You could either implement a cron job to process the images or hook into the File Upload plugin and optimize them in place.

    The FileUpload plugin fires an event when an image is uploaded. Hook into Gdn_Upload_SaveAs_Handler($sender) and optimize the temporary image. Here is the pertinent lines you would need to re-implement if you can't do it in place:

    Search first

    Check out the Documentation! We are always looking for new content and pull requests.

    Click on insightful, awesome, and funny reactions to thank community volunteers for their valuable posts.

Sign In or Register to comment.