Login to download the latest version of Mint and your favorite Pepper, purchase additional licenses, or post in the Forum. Don't have an account? Create one!

In Partnership with Media Temple

Mint Forum

Can/should the mint js script be cached?

stormy
Minted
Posted on Mar 29, '08 at 05:53 pm

I’m working on optimizing page load. I’m planning on using a small php script to consolidate all js on the page, gzip them and set an Expires header for next week.

Can the mint js be included in this, or will that affect tracking?

Till
Third-Party Pepper Developer
Posted on Mar 30, '08 at 06:33 am

No, you can’t cache it.

Sam Brown
Third-Party Pepper Developer
Posted on Mar 30, '08 at 07:16 am

What Till said, each Mint hit has a unique Key, caching it wouldn’t work.

stormy
Minted
Posted on Mar 31, '08 at 10:36 am

I see it’s already sent gzipped, so no worries. Thanks!

ryos
Minted
Posted on Apr 01, '08 at 12:10 am

Besides which, the Mint JS include is ridiculously small. Most of the time spent loading it is due to the execution of the PHP script that it fronts.

Technically speaking, you could do an external server‐side include if you want to reduce the number of requests to the server. This would slow down the creation of the main JavaScript, but may be worth the extra processing time if you are able to do it with a local reference to the script (use localhost instead of external domain).

// rest of JS file then Start Mint Analysis

?php include_once(“http://localhost.lan/mintanalysis/?js”);

// End Mint Analysis

// rest of JS file

This would preserve the unique IDs.

PS: I am not sure where in the pipe‐line cookies are set. You should look into this.

Shaun Inman
Mint/Pepper Developer
Posted on Apr 21, '08 at 09:22 am

Technically speaking, you could do an external server‐side include if you want to reduce the number of requests to the server.

This will not work. The Mint JS cannot be cached. Anyone who says otherwise doesn’t know what they’re talking about.

Done one the fly with externall references, this would work. Just try. :-)

You must be logged in to reply. Login above or create an account

Hey there, I have officially suspended sales and support of Mint. The Create Account, Add License, Transfer License, and Contact forms have been disabled. Existing customers may continue to login and download Mint.

More info Continue