Self-Hosting External Resources

Updated on 12. 6. 2025

Self-Hosting External CSS and JavaScript Files

What is Self-Hosting?

Self-hosting automatically downloads external CSS and JavaScript files to your server and serves them locally. This improves page loading performance, privacy, and reliability.

Key Benefits

  • Faster loading times: Reduced external HTTP requests
  • Enhanced privacy: No external connections required
  • Better reliability: Independence from external servers
  • Improved caching: Full control over cache headers
  • GDPR compliance: Reduced third-party data sharing

How It Works

When self-hosting is enabled, ZiziCache automatically:

  1. Detects external CSS and JavaScript files
  2. Downloads them to your server’s cache directory
  3. Updates HTML references to point to local files
  4. Serves files from local cache with optimized headers
  5. Maintains updates when source files change

Configuration

Enable self-hosting in Optimization � General � Host external CSS and JS locally

Automatic Processing Features

  • Resource hints cleanup: Removes unnecessary preload/prefetch
  • Origin tracking: Tracks original URL in data-origin-src attribute
  • Integrity removal: Removes integrity and crossorigin attributes for local files
  • Cache management: Intelligent cache invalidation and updates

Security

Downloaded files are stored in a protected directory with:

  • Strict file type validation (only .css and .js files allowed)
  • PHP execution prevention
  • Access logging for security monitoring
  • Automatic .htaccess protection

Best Practices

  • Monitor disk space usage in admin dashboard
  • Regularly clear external file cache if needed
  • Test functionality after enabling on staging sites first
  • Verify that external resources don’t require dynamic updates
What are your feelings