48 lines
1.3 KiB
HTML
48 lines
1.3 KiB
HTML
<html>
|
|
<head>
|
|
<title>CDN TEST</title>
|
|
</head>
|
|
<body>
|
|
<h1>TEST</h1>
|
|
<p>
|
|
direct static
|
|
<img height="128" src="static/gopher_profilovka.png" alt="gopher"/>
|
|
</p>
|
|
<p>
|
|
cdn static
|
|
<img height="128" src="https://static.cdn.zerops.app/nginx.zerops.matejpavlicek.cz/static/gopher_profilovka.png" alt="gopher"/>
|
|
</p>
|
|
<p>
|
|
direct s3
|
|
<img height="128" src="https://storage-prg1.zerops.io/4gh42-bucket1/gopher_profilovka.png" alt="gopher"/>
|
|
</p>
|
|
<p>
|
|
cdn s3
|
|
<img height="128" src="https://storage.cdn.zerops.app/4gh42-bucket1/gopher_profilovka.png" alt="gopher"/>
|
|
</p>
|
|
<p>
|
|
fetch static
|
|
<div id="image-container"></div>
|
|
</p>
|
|
|
|
<script>
|
|
fetch('https://static.cdn.zerops.app/nginx.zerops.matejpavlicek.cz/static/gopher_profilovka.png')
|
|
.then(response => response.blob())
|
|
.then(blob => {
|
|
const objectURL = URL.createObjectURL(blob);
|
|
const img = document.createElement('img');
|
|
img.height = 128;
|
|
img.src = objectURL;
|
|
img.alt = 'gopher'
|
|
document.getElementById('image-container').appendChild(img);
|
|
|
|
img.onload = () => {
|
|
URL.revokeObjectURL(objectURL);
|
|
};
|
|
})
|
|
.catch(error => {
|
|
console.error('Error:', error);
|
|
});
|
|
</script>
|
|
</body>
|
|
</html> |