jetpack icon indicating copy to clipboard operation
jetpack copied to clipboard

Expert mode conflicts with autoptimize

Open landwire opened this issue 1 year ago • 1 comments

Impacted plugin

Super Cache

Quick summary

See this article: https://gregsullivan.com/wordpress/autoptimize-wp-super-cache-conflict/

This seems to be still the case now. Could this be fixed?

Steps to reproduce

  1. Install WordPress on an Apache server.
  2. Install and activate WP Super Cache and Autoptimize.
  3. Set Autoptimize to aggregate JavaScript and css.
  4. Turn on WP Super Cache and set its delivery method to Expert.

WP Super Cache’s Expert delivery method uses mod_rewrite instead of php to serve files, so the plugin generates a .htaccess file when that delivery method is activated. Inside the file is this line:

Header set Cache-Control 'max-age=3, must-revalidate' Applied to all files in the cache directory’s subdirectories, it reduces cache time to three seconds. (So if you’re refreshing very quickly, cached versions of your Autoptimize files might be served by your browser the first one or two times before requiring another trip to the server for validation.)

A clear and concise description of what you expected to happen.

Autoptimize files not to be affected.

What actually happened

No response

Impact

Some (< 50%)

Available workarounds?

Yes, difficult to implement

Platform (Simple and/or Atomic)

No response

Logs or notes

No response

landwire avatar Jun 15 '24 23:06 landwire

It could be fixed by moving the .htaccess file to the cache/supercache directory, but Page Optimize has a workaround, so I'm inclined to say we leave it as-is. Anyone else?

donnchawp avatar Jul 02 '24 07:07 donnchawp