WordPress.org

Ready to get started?Download WordPress

Forums

W3 Total Cache
[resolved] Minified CSS default include naming problem with WP 3.0 and W3TC 0.9 Develo (15 posts)

  1. Andrew Biss
    Member
    Posted 4 years ago #

    Hi,

    Great plugin!

    I have updated to WordPress 3.0 and have the latest development build of W3TC.

    With CSS Minify enabled the CSS is not found when displaying the site. I am using the Thesis 1.7 theme and have these 3 CSS items in the minify list:

    wordpress/wp-content/themes/thesis_17/style.css
    wordpress/wp-content/themes/thesis_17/custom/layout.css
    wordpress/wp-content/themes/thesis_17/custom/custom.css

    All these files exist and are shown OK when clicking on the "Verify URI" buttons.

    The generated HTML has a link to the following generated CSS include file http://mydomain.com/wordpress/wp-content/w3tc/min/thesis_17/thesis_17/default.include.0.css. This fails with a HTTP/1.0 400 Bad Request error as this file does not exist.

    That directory only contains a single file named default.include.css.id, of length 1 byte that contains ASCII "0".

    I am not using the multisite option in WordPress 3.0.

    The CSS minify settings were working OK with WordPress 2.9.2 before the update to 3.0.

    Any ideas?

    Thanks and best regards,

    Andrew.

    http://wordpress.org/extend/plugins/w3-total-cache/

  2. Frederick Townes
    Member
    Plugin Author

    Posted 4 years ago #

    So your blog is installed at http://mydomain.com/wordpress/ ?

  3. Andrew Biss
    Member
    Posted 4 years ago #

    Yes, I have the WordPress 3.0 installation in http://mydomain.com/wordpress/ and just the index.php file in the root directory.

    This was the setup when I was using WordPress 2.9.2 and earlier versions and these worked OK with W3TC.

    I download the latest W3TC development version yesterday to see if that resolved the problem, but no luck. The minified CSS file was still not being generated correctly.

  4. Frederick Townes
    Member
    Plugin Author

    Posted 4 years ago #

    I think you should submit a bug submission form from the support tab of the plugin so I can take a closer look.

  5. Greg Rickaby
    Member
    Posted 4 years ago #

    Andrew, I run Thesis too. You cannot minify/combine /thesis_17/layout.css

    Here is why:

    Thesis re-builds layout.css on every page refresh (seriously).

    When you use the Design Options in Thesis Admin to set your colors and fonts then click the "Big Ass Save Button", Thesis stores those settings in the database. With every page-view, Thesis runs an object that grabs those database settings and re-builds layout.css.

    You see, Thesis requires you use to use custom.css to CANCEL out ID's and Classes used in layout.css, so when you minify/combine stylesheets, default.include.0.css loads first in the page <head> and layout.css loads last. Thus, making custom.css useless.

    Here is why:

    All browsers read the last style-sheet in <head> (normally custom.css) and makes it the "most important", thus things you do in custom.css "cancel out" layout.css

    My experience has been (with Thesis) is to minify/combine all style-sheets (including plug-in style-sheets) with the exception of both layout.css and custom.css. This will preserve the natural order of things within Thesis and render your site correctly.

    Hope this helps, and maybe I should write a blog post about it :)

  6. Frederick Townes
    Member
    Plugin Author

    Posted 4 years ago #

    Good tips @gregrickaby.

  7. Andrew Biss
    Member
    Posted 4 years ago #

    @gregrickaby,

    Thanks for your comments about CSS and Thesis.

    My understanding of how Thesis works with the CSS files is a little different, so I had a quick look at the theme source to see what it is really doing.

    When you change the design options using the Admin panels then Thesis saves this information into the database and writes the layout.css file to disk using function thesis_generate_css(). This disk file is only updated when you make changes via the Admin panels (which seems reasonable).

    It should be possible to minify and combine the generated Thesis CSS files along with a local custom.css override file using W3TC. I was combining and minifying my CSS without any problems using W3TC, WordPress 2.9.2 and Thesis 1.7.

    Where the confusion might arise is that Thesis dynamically rebuilds the CSS objects in memory for each page as it needs to calculate some information such as line heights or maximum image widths. Rather then reading and parsing this information from the on-disk CSS files, Thesis just rebuilds the in-memory objects from the database values.

    Looking at the code, however, it does not seem that Thesis rebuilds the CSS files on disk for each page load. Again this seems reasonable and is also consistent with the use of cachebuster timestamps on the CSS files.

    So I am not really any clearer on the source of my problem with W3TC and WordPress 3.0. At the moment it seems to me to be an issue with the change to W3TC for multi-suite support in WordPress 3.0, and not being due to the Thesis theme.

    I will continue to investigate and see if I can see what is going on and why the combined CSS file default.include.0.css is not being created by W3TC.

  8. Frederick Townes
    Member
    Plugin Author

    Posted 4 years ago #

    v0.8.5.2 is not compatible with WP 3.0 as indicted on the plugin description page. You have to use the development version (v0.9) with WP 3.0.

  9. Andrew Biss
    Member
    Posted 4 years ago #

    I installed the W3TC development build before updating to WordPress 3.0.

  10. Frederick Townes
    Member
    Plugin Author

    Posted 4 years ago #

    When is the last time you updated?

  11. Andrew Biss
    Member
    Posted 4 years ago #

    The W3TC development version as at 23rd June.

  12. hayesgb
    Member
    Posted 4 years ago #

    Sorry about jumping in here, but I've noticed the same behavior with my theme. Frederick -- do you know if Frugal theme loads information the same way as Thesis? It may give me some hints about how to minify the .css on my site.

    Thanks!

  13. Greg Rickaby
    Member
    Posted 4 years ago #

    I combine all my style sheets (except layout.css) on this website: http://www.buzzmontgomery.com

    In the Minify/Combine settings of W3T here is my CSS order:

    1) wp-content/themes/thesis_17/style.css
    2) wp-content/themes/thesis_17/lib/css/ie.css
    3) wp-content/plugins/nextgen-gallery/css/nggallery.css
    4) wp-content/plugins/wp-polls/polls-css.css
    5) wp-content/plugins/wp-calendar/css/fullcalendar.css
    6) wp-content/themes/thesis_17/custom/custom.css
    7) wp-content/themes/thesis_17/custom/home.css
    8) wp-content/themes/thesis_17/custom/ie.css

    This works for me.

  14. Andrew Biss
    Member
    Posted 4 years ago #

    I see from the HTML your minified CSS is in /wp-content/w3tc/min/thesis_17/thesis_17/default.include.4223048014.css whereas mine is in /wordpress/wp-content/w3tc/min/thesis_17/thesis_17/default.include.0.css.

    The first difference is that you have WordPress installed in the root directory and I have WordPress in a sub-directory, but that looks OK.

    The more interesting difference is you have 4223048014 in the CSS file name, whereas I have 0 in my CSS file name (and that file is not being generated).

    I have double checked permissions of my CSS files and all permissions and ownerships look good.

    Next step is to have a look at the W3TC code to see what this number represents (a timestamp?) and whether that gives any insight into where the problem is.

  15. Frederick Townes
    Member
    Plugin Author

    Posted 4 years ago #

    That error is because some file in the CSS minify config cannot be found. I'll try to add a notification to assist with troubleshooting.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic