Join our Facebook Group
ScriptsTribe • Sngine • Community
Join

Forum

The great place to discuss topics with other users

ready-to-follow Sngine optimization checklist

'
Join the Conversation Στέλνω απάντηση
Edy Lee
Admin
Joined: 2024-11-24 00:57:42
2025-09-27 02:47:51

Sngine Performance Optimization Checklist


1. Server & PHP Setup

  1. Upgrade PHP: Use PHP 8.2+ for better performance.

  2. Enable OPcache:

    • Edit php.ini:

       
      opcache.enable=1 opcache.memory_consumption=256 opcache.max_accelerated_files=10000 opcache.validate_timestamps=1
  3. Enable Gzip/Brotli:

    • Nginx:

       
      gzip on; gzip_types text/plain text/css application/json application/javascript text/xml application/xml application/xml+rss text/javascript;
    • Apache:

       
      AddOutputFilterByType DEFLATE text/html text/plain text/xml text/css application/javascript
  4. HTTP/2: Enable in your web server for faster multiplexed requests.

  5. Use SSD hosting or VPS over shared hosting.


2. Database Optimization

  1. Index common columns:

    • users.id, posts.id, posts.user_id, likes.post_id, comments.post_id

  2. Clean old logs:

    • In x_log, sessions, notifications, remove outdated entries.

  3. Optimize queries:

    • Check slow queries using MySQL slow_query_log.

    • Example:

       
      EXPLAIN SELECT * FROM posts WHERE user_id = 123;
    • Add indexes if necessary.

  4. Use proper data types:

    • INT for IDs, VARCHAR(100) for small strings instead of TEXT.


3. Sngine Configuration & Code

  1. Feed Optimization:

    • Limit posts per page:
      Edit /content/themes/unity+/controllers/posts.php:

       
      $limit = 20; // instead of 50+
  2. Use AJAX Loading:

    • Infinite scroll or “Load More” instead of loading all posts at once.

  3. Disable unused plugins/modules:

    • Check /content/plugins/ and /content/themes/unity+/controllers/modules/.

  4. Reduce repeated queries:

    • Cache frequently accessed data like:

      • Logged-in user info

      • Notifications

      • Trending posts


4. Caching

  1. Page caching:

    • Use LiteSpeed Cache if server supports it, or Nginx FastCGI cache.

  2. Query caching:

    • Use Redis or Memcached for caching results of frequent queries.

  3. Object caching:

    • Cache user, post, notifications objects in memory.


5. Asset Optimization

  1. Minify JS & CSS:

    • Use tools like UglifyJS, CSSNano, or built-in minifiers.

  2. Combine files:

    • Reduce HTTP requests by merging small JS/CSS files.

  3. Use WebP for images:

    • Replace JPG/PNG with WebP.

  4. Lazy load images:

    • Example in templates:

       
      <img src="placeholder.jpg" data-src="real-image.webp" class="lazyload">
  5. Compress images:

    • Use tinypng.com or similar.


6. Content Delivery Network (CDN)

  • Use Cloudflare, StackPath, or BunnyCDN.

  • Serve /uploads/ and static assets (CSS/JS) through CDN.


7. Monitoring & Analysis

  1. PageSpeed & Lighthouse:

    • Test regularly for:

      • LCP (Largest Contentful Paint)

      • FCP (First Contentful Paint)

      • TTI (Time to Interactive)

  2. Server Monitoring:

    • Use New Relic, PHP-FPM status, or htop to monitor CPU/RAM usage.

  3. Database Monitoring:

    • Monitor slow queries and high-load queries.


8. Optional Advanced Tweaks

  1. Queue system for heavy tasks:

    • Notifications, emails → Redis + Laravel Queue or RabbitMQ.

  2. Varnish Cache:

    • Full-page caching to reduce server load.

  3. Database replication:

    • For very high traffic, separate read/write queries.


Extra Tip:
Enable lazy loading for feeds, notifications, and comments—these are often the heaviest parts of Sngine pages. This alone can reduce initial page load by 50–70%.

Edy Lee
Admin
Joined: 2024-11-24 00:57:42
2025-09-27 02:49:04

Improving Sngine performance involves both server-side and client-side optimizations since Sngine is PHP/MySQL-based and can be heavy if not optimized. Here’s a step-by-step guide:


1. Optimize Your Hosting Environment

  • Choose a fast server: Use VPS or dedicated hosting instead of shared hosting.

  • PHP version: Use the latest stable PHP (e.g., PHP 8.2+) for performance improvements.

  • Database: MySQL/MariaDB should have optimized settings (innodb_buffer_pool_size, query_cache_size).

  • Enable OPcache: This caches PHP bytecode for faster execution.

  • SSL & HTTP/2: Faster HTTPS connections improve load times.


2. Optimize Database

  • Index frequently queried fields: e.g., posts, users, likes.

  • Clean old data: Delete old logs, sessions, and temporary files.

  • Use proper data types: Avoid TEXT or VARCHAR(255) when smaller fields suffice.

  • Optimize queries: Use EXPLAIN to check slow queries and add indexes as needed.


3. Enable Caching

  • Page caching: Use tools like LiteSpeed Cache or NGINX FastCGI cache.

  • Database query caching: Use Redis or Memcached to cache frequent queries.

  • Object caching: Cache objects like user info, notifications, and posts.


4. Optimize Assets

  • Minify CSS & JS: Use tools to reduce size.

  • Combine files: Reduce HTTP requests.

  • Use Gzip/Brotli: Enable compression on the server.

  • Lazy load images: Especially in feeds or media-heavy pages.

  • Use WebP for images to reduce size.


5. Optimize Sngine Code

  • Limit feed queries: Use LIMIT and OFFSET efficiently.

  • Use AJAX for loading posts: Instead of loading all posts at once.

  • Reduce unnecessary queries: Avoid repeated queries in loops.

  • Check modules/plugins: Disable any unused plugins to reduce overhead.


6. Use a Content Delivery Network (CDN)

  • Serve static files (images, JS, CSS) through a CDN.

  • Offload traffic from your server and reduce latency for global users.


7. Monitor and Test

  • Use Google PageSpeed Insights, GTmetrix, or Lighthouse.

  • Identify slow queries using MySQL slow query log.

  • Monitor server performance with tools like New Relic or PHP-FPM status.


8. Optional Advanced Tweaks

  • Varnish Cache: For full-page caching.

  • Memcached/Redis: For session caching.

  • Database replication: If you have very high traffic, consider read-replicas.

  • Queue system: Offload heavy tasks (like notifications or emails) to a queue system (Redis + Laravel Queue or RabbitMQ).

ScriptsTribe https://scriptstribe.com