• Resolved mintmedia

    (@mintmedia)


    Hi!

    We love the optimize/aggregate and minification features for CSS and JS files that Autoptimize offers. However, we have some files (primarily JQuery) from website and from certain plugins that are being cached despite excluding from optimizations.

    Is there a way to set/make sure that certain JS files NEVER get cached? What would be the best approach to this?

Viewing 15 replies - 1 through 15 (of 35 total)
  • Plugin Author Optimizing Matters

    (@optimizingmatters)

    Sure, you should:
    1. exclude the files in the exclusion field (CSS and/ or JS)
    2. disable the “Minify excluded CSS and JS files?” option

    hope this helps,
    frank

    Thread Starter mintmedia

    (@mintmedia)

    We did but the file is still being cached…

    Thread Starter mintmedia

    (@mintmedia)

    Thread Starter mintmedia

    (@mintmedia)

    Plugin Author Optimizing Matters

    (@optimizingmatters)

    ah, but excluding from Autoptimize caching (minification/ aggregation) does not mean excluding from browser caching actually. browser caching is not managed by AO, but by the browser based on webserver settings, typically (but not necessarily) in the .htaccess file ??

    Thread Starter mintmedia

    (@mintmedia)

    Right but I believe it is not supposed to be server side caching as are using WP Engine and this is a password protected site (HTTP). WP Engine support told me that if the site is pw protected, it is not supposed to be doing any server side caching.

    Plugin Author Optimizing Matters

    (@optimizingmatters)

    but that jquery.min.js is cached browser-side, no server-side caching being done for that ??

    Thread Starter mintmedia

    (@mintmedia)

    So Ideally we just set a no cache policy for all these files right? Btw, thank you for the quick responses!

    Plugin Author Optimizing Matters

    (@optimizingmatters)

    as this concerns browser caching of static resources (javascript or css files for example), the only thing a “no cache policy” would do is slow the site down for users who have the password to access the site, so not sure if you would need/ want to change anything there? ??

    Thread Starter mintmedia

    (@mintmedia)

    Hopping back in here. You are right. No-cache policy is not worth it for what we are trying to achieve.

    Is there any way to have the JS files that are not being optimized by Autoptimize to have them optimized (essentially, we would want these optimized and fingerprinted with the autoptimize_… filename)?

    Such as these files in our dist/ paths: https://ibb.co/2FhDVTW

    Once again, thank you so much for all of the guidance and help thus far.

    Plugin Author Optimizing Matters

    (@optimizingmatters)

    Autoptimize does not minify files that are minified already (according to the filename ending in min.js) mintmedia, the only alternative would be switching to “aggregate javascript” but that might not always be the best option from a performance point of view.

    Thread Starter mintmedia

    (@mintmedia)

    So if we aggregate js, it would aggregate all js files including those I portrayed above?

    Additionally, if we removed the …min.js filename, would Autoptimize then optiomize these files as well?

    Plugin Author Optimizing Matters

    (@optimizingmatters)

    So if we aggregate js, it would aggregate all js files including those I portrayed above?

    yes (although there _might_ be some configuration challenges to be overcome to ensure _all_ files are aggregated)

    Additionally, if we removed the …min.js filename, would Autoptimize then optiomize these files as well?

    If you make sure the files are enqueued as such as well (in WordPress) then yes.

    Plugin Author Optimizing Matters

    (@optimizingmatters)

    No feedback so I assume this got resolved? Feel free to follow up if you still encounter issues!

    have a nice day!
    frank

    Thread Starter mintmedia

    (@mintmedia)

    Hi sorry. Was reviewing quite a few things. I believe we will be going the route of removing the .min from WP file names.

    We have another question. We would like to preload our Autoptimize optimized JS and CSS files in a particular area. How can this be done?

Viewing 15 replies - 1 through 15 (of 35 total)
  • The topic ‘Excluding certain files from being cached’ is closed to new replies.