How to leverage browser caching for page speed? Hubspot won't allow modification of .htaccess

@jennysowyrda great points on the analytics scripts department, I think it’s fair to say that if we compare analytics script caching policies across tools like Facebook, Google, Vimeo and Hubspot we will see similar tactics, so it’s difficult to say that Hubspot is not doing its utmost in this department.

In the majority of cases, I educate clients that 3rd party scripts are beyond our reach when it comes to caching policies and to expect these to appear as breaking the “efficient cache policy rules” according to speed test. These scripts are loaded via 3rd party servers and it’s up to them to determine how they would like the browser to cache the scripts. Hubspot should fall into this category.

Often it is the case that clients can become **bleep**-bent on page speed scores improvements from tools like Lighthouse and GT Metrix. This is not always wrong, but also not always the best investment of time.

But, and there’s always a but, there exists little reason for Hubspot to not expose browser cache configuration to clients. Hubspot offloads to Cloudflare for a majority of CDN requirements, and rightfully so, Cloudflare is incredible! Cloudflare also offers direct clients to adjust browser cache policies and purge cache via APIs or the admin panel (ref: screenshot). And all of this goes without the mention of file revisioning tactics that can allow you to set a high browser cache and flush through updating file names thus naturally flushing browser cache.

So what are some solutions that can help ease everyone’s pain
16x16_smiley-very-happy.png
:

  1. Allow Hubspot users to set their own browser cache policies for static assets delivered via the Hubspot CDN / Cloudflare similar to how Cloudflare allows this in their own portal
  2. Enforce the most performant or recommended cache policies for static assets while implementing static asset revisioning policies when files hosted on Hubspot are updated


Example of browser cache settings in Cloudflare