What are some modern techniques for improving website performance and loading times in PHP, especially in comparison to outdated methods like framesets?

One modern technique for improving website performance and loading times in PHP is to utilize asynchronous loading of resources, such as images and scripts, to prevent blocking the rendering of the page. This can be achieved by using techniques like lazy loading or deferring the loading of non-essential resources. Another approach is to optimize the server-side code by implementing caching mechanisms, such as opcode caching or using a content delivery network (CDN) to serve static assets.

// Example of lazy loading images in PHP
echo '<img src="placeholder.jpg" data-src="image.jpg" class="lazyload" />';
```

```php
// Example of deferring script loading in PHP
echo '<script defer src="script.js"></script>';
```

```php
// Example of server-side caching in PHP using APCu
$key = 'cached_data';
$data = apcu_fetch($key);

if ($data === false) {
    $data = fetchDataFromDatabase();
    apcu_store($key, $data, 3600); // Cache for 1 hour
}

echo $data;