bg

Optimized Assets

Optimized Assets API is an efficient solution for managing and optimizing media assets on your website.

Overview

This API allows users to submit their images to our servers for an automatic optimization process, without the need to store images permanently on our servers. Using this API, submitted images will be processed to reduce file size without sacrificing visual quality, thereby speeding up page load times and improving user experience.

Feature

  • Image Optimization: Reduce image file size with advanced compression techniques without reducing visual quality.
  • CSS & JS Optimization: Reduce CSS and JS file size with advanced compression techniques without compromising code quality.
  • Automatic Process: Images sent to the API will be automatically optimized and immediately returned to the user.
  • No Permanent Storage: Images are not stored on the server, maintaining privacy and reducing storage requirements.
  • Automatic Renaming: Optimized images will be renamed to standard formats such as origin-image.png for ease of use.
  • Easy Integration: The API is designed to be easily integrated into existing workflows and systems.

API Endpoint

https://optimized.i-as.dev/api/optimize-assets

Curl URL

curl -X POST "https://optimized.i-as.dev/api/optimize-assets" \
     -H "quality: 80" \
     -H "css: true" \
     -H "js: true" \
     -H "lazy: true" \
     -F "formData=@path/to/your/file"  # Adjust the path to your file if needed

Basic Use

<script>
	const optimizedAPI = 'https://optimized.i-as.dev/api/optimize-assets';
	const optimizedConfig = {
		quality: '80',
		css: true,
		js: true,
		lazy: true
	};
</script>
  • quality: '80': Specifies the optimization quality as 80%.
  • css: true: Enables optimization for CSS files.
  • js: true: Enables optimization for JavaScript files.
  • lazy: true: Enables lazy loading techniques for assets.

Example Use

<body>
    <div class="container">
        <h1>Image Optimization Test</h1>
        <img src="local-img.jpg" alt="Example Local Images">
        <img src="https://optimized.i-as.dev/assets/images/logo-icon.png" alt="Example Url Images">
    </div>
	
	<!-- Add before </body> -->
    <script>
		const optimizedAPI = 'https://optimized.i-as.dev/api/optimize-assets';
		const optimizedConfig = {
			quality: '80',
			css: true,
			js: true,
			lazy: true
		};
	</script>
    <script defer src="https://optimized.i-as.dev/assets/js/optimized.js"></script>
</body>