• Resolved liquidRock

    (@liquidrock)


    Minifying
    I’m testing out W3 Total Cache on a staging site and noticed if I try to minify HTML and CSS I’m getting prompted to put in my login/pass (for cpanel directory privacy) for every asset that loads. It also breaks the CSS (doesn’t style the page) even though I verified the URL and it is correct. That primary CSS is also importing an external CSS file from MyFonts.com for purchased webfonts. I disabled messing with that just in case, but it didn’t solve the problem. I’m ignoring JS for now as I’m using SRI with integrity checks which would be broken if your plug-in altered them.

    Headers
    Is there a way to disable WordPress from hijacking the cache headers? It keeps settings the expires date to 1984 and max to 0, even with W3 Total Cache enabled. I tried some suggestions from stackoverflow to remove the headers in functions.php but that doesn’t seem to get rid of the date, only the no-cache stuff. I’d also like to know if there is a way to set your plug-in to follow the expires time I have set globally in Apache includes, or if there is an override for specific things in the settings I have missed (I have CSS, JS and fonts set to 6 months and HTML set to a day and a half, and front pages and other pages to refresh on new post publishing).

    File Permissions
    As for file permissions, is there a way to disable your plug-in alert after I config everything? I want to set my permissions for htaccess and wp-config to 444. Even after your directives are added, it still throws an alert if I change the permissions from 644 to 444.

    Thanks

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Contributor Marko Vasiljevic

    (@vmarko)

    Hello @liquidrock

    Thank you for reaching out and I am happy to help!

    1. Can you please confirm that Minify is disabled for logged-in users in Performance>Minify and also Disable the page caching for logged-in users in Performance>Page Cache? Make sure to manually delete the /cache/ folder or /cache/page-enhanced/ and /cache/minify/ and see if the issue persists. Make sure that minify is disabled first.
    There is a possibility that some CSS files need to be excluded from caching so you can add the path for those/that file to “Never minify following CSS files” in Performance>Minify>Advanced, for example:
    /wp-content/themes/some-theme/assets/css/some-css-file.css and make sure to save all settings and purge the cache.

    2. This is something you have to check with your hosting provider. Possibly there are some nested .htaccess or the configuration the httpd.conf.

    3. Short answer is no. W3 Total Cache needs to have the write permission to the .htaccess file so it can remove or write the rules depending on your W3TC configuration.
    There is no way to disable the notification without messing with the plugin’s code, which will be overwritten with the next update.

    I hope this helps!

    Thread Starter liquidRock

    (@liquidrock)

    I tried those settings for minifying CSS. It may just be my file. Not a huge deal. I can just minify it myself manually to ensure it works. The caching of CSS works just fine.

    As for the Headers, I think you misunderstood, so I’ll clarify:

    I have mod_expires directives set in Apache includes. This works fine across all domains on my server. However, your plugin overrides what I want set, AND WordPress Core seems to override the max-age for type text/html and sets the HTML file date to January 11 1984, forcing the browser to keep fetching the html even if it hasn’t changed and is cached by W3TC.

    Inspecting headers for HTML gives the following with or without W3 TC activated:

    cache-control: no-cache, must-revalidate, max-age=0
    expires: Wed, 11 Jan 1984 05:00:00 GMT

    This is forcing HTML files not to cache in the browser even with your plugin active. I thought you guys might know how to stop WordPress from doing this.

    I’m also curious if W3TC can use MY expires time for HMTL, CSS, JS and fonts or not override them as there’s no reason to—i.e maybe it would be nice to have an option for users to NOT set a new expires time via checkboxes for those common file types: ? use existing expires for CSS. I want them set to 6 months or 1 year, because I have versioning setup with my enqueued CSS files based on file modification date so that if I update them the browser will automatically dump the cached version and download the new one as WordPress enqueue will tack on a new version and it will appear as a new file.

    CSS versioning example:
    /library/css/style.css?ver=1634718926

    The primary thing is HTML though. Seems wasteful to have users keep downloading the HTML unnecessarily if no new posts have been published and no changes to templates have been made, especially for mobile users where speed can be less than desirable.

    Hope this makes more sense. Thanks

    Plugin Contributor Marko Vasiljevic

    (@vmarko)

    Hello @liquidrock

    If I understand correctly, you want yoru own BC rules to apply instead of the W3TC rules?
    If that is the case, you can simply disable the Browser Cache in Performance>General settings, or disable the individual settings in Performance>Browser Cache to avoid conflict with your rules.
    I hope this helps!
    Thanks!

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Cache Header date, Minifying, and file permissions’ is closed to new replies.