TTFB under 300ms on shared hosting is honestly ambitious because you're fighting against noisy neighbors and limited resources, but it's definitely achievable with the right optimizations. The single biggest impact I've seen is switching to a host that uses LiteSpeed with LSCache instead of Apache - I moved a client's site from traditional shared hosting to LiteSpeed and TTFB dropped from around 800ms to 200ms literally overnight without changing anything else. LiteSpeed has built-in caching at the server level that's way more efficient than PHP-based caching, and if your current host doesn't offer it, that alone might be worth switching hosts. If you're stuck with Apache, at least make sure you're on PHP 8.1 or newer with OPcache enabled because the performance difference between PHP 7.4 and 8.1 is substantial, sometimes 30-40% faster.
For OPcache specifically, most shared hosts have conservative default settings that you can improve if you have access to php.ini or can use ini_set in your wp-config.php file. Try setting opcache.memory_consumption to at least 128MB, opcache.interned_strings_buffer to 16, and opcache.max_accelerated_files to 10000 or higher. I had a WooCommerce site where just bumping max_accelerated_files from the default 2000 to 10000 shaved about 80ms off TTFB because it was constantly evicting cached files and recompiling. Also enable opcache.validate_timestamps=0 in production so it's not checking if files changed on every request, though remember you'll need to manually clear OPcache when you update plugins. For MySQL, if you have access to configuration, increase query_cache_size and innodb_buffer_pool_size, but honestly on shared hosting you probably can't touch these settings.
The other game-changer is implementing object caching with Redis or Memcached if your host supports it, because WordPress makes dozens of database calls per page load by default and caching those objects in memory is massive for TTFB. I set up Redis on a client's site that was averaging 600ms TTFB and it dropped to around 250ms just from eliminating repeated database queries. Install the Redis Object Cache plugin and make sure it's actually connected and working - you can check in the plugin settings. Also don't overlook simple things like enabling Gzip compression, making sure your wp-config.php sets WP_CACHE to true, and limiting the number of plugins because each active plugin adds overhead. I've seen sites where disabling just 2-3 poorly coded plugins that hook into every page load reduced TTFB by 100ms. Finally, if you're doing everything right and still hitting walls, shared hosting might just be your bottleneck - sometimes paying a bit more for VPS or managed WordPress hosting with better resource allocation is the only real solution when you've maxed out what's possible on shared infrastructure.