Extension, Plugin

Archived
Forum
(read-only)

Minimee

ExpressionEngine 2

Back to this add-on's main page
View Other Add-ons From John D. Wells

1 of 2
1
   

Thousands of extra empty cache files

Bug Report

shift2design
shift2design

I am using MinimEE to combine some CSS and JS files. This has been working fine, but it is also generating thousands (over time) of empty files. See attached screenshot. This is on a windows server. What are these files, are they temporary files perhaps? Windows Server 2003. I would like to get these cleaned up. If I delete they just re-generate. Help?

shift2design
# 1
shift2design

You can see the 3 unique files (green icons) that are the correct ones.

John D Wells
# 2
Developer
John D Wells

Hi shift2design,

I’ve never seen Minimee produce thousands of empty files like that.  Could you paste in an example of how you’re using Minimee?

Do the empty files have extensions?

Do the empty files have “.0000000000” at the end of their filenames?

What version of EE and Minimee are you running?

Cheers,
John

shift2design
# 3
shift2design

I disabled Minimee and deleted cache files. As soon as I re-enabled Minimee the directory started filling with these files again on every page load.

There are no file extensions, the files are 0kb and are empty when you open them. There were over 6,500 between yesterday to today.

I am running Minimee 2.1.7 on EE 2.5.3 (Win Server 2003)

Thanks. At the moment I just left the addon disabled.

John D Wells
# 4
Developer
John D Wells

If you’re willing, can you try this version of Minimee which I have under development:

https://github.com/johndwells/Minimee/archive/version2.zip

Again, if you can also copy-and-paste an example of how you’re using Minimee that might be useful.

Is this an extremely visited site?  Does your site use a lot of CSS and JS files?

Cheers,
John

shift2design
# 5
shift2design

Thanks for response. Yes, it uses quite a few CSS and JS files. It gets a fair amount of traffic, ~1k views daily now (off season) and 5k+ during reg season. I am pasting a portion of the html head where I use MinimEE. It creates the css and js files correctly, and updates when changed, but just not sure why all these extre empty files are being generated. I can try to install that new version early this week.

{exp:jquery:script_tag}

{exp
:minimee:css}
     
<link rel="stylesheet" type="text/css" href="{site_url}assets/foundation-4.0.3/css/normalize.css">
     <
link rel="stylesheet" type="text/css" href="{site_url}assets/css/colorbox.css">
     <
link rel="stylesheet" type="text/css" href="{site_url}assets/css/FontAwesome.3.1.1/font-awesome.min.css">
     <
link rel="stylesheet" type="text/css" href="{site_url}assets/foundation-4.0.3/css/foundation.css">
     <
link rel="stylesheet" type="text/css" href="{site_url}assets/css/foundation-datepicker.css">
     <
link rel="stylesheet" type="text/css" href="{site_url}assets/css/lt-ie9.css">
     <
link rel="stylesheet" type="text/css" href="{site_url}assets/css/print.css">
     <
link rel="stylesheet" type="text/css" href="{site_url}assets/foundation-4.0.3/css/app.css">     
     <
link rel="stylesheet" type="text/css" href="{site_url}assets/css/custom-editor-styles.css"
{/exp:minimee:css}

<!--[if IE 7]>
     <
link rel="stylesheet" type="text/css" href="{site_url}assets/css/FontAwesome.3.1.1/font-awesome-ie7.min.css">
<!
[endif]-->

{exp:minimee:js}
     [removed][removed]
     [removed][removed]
     [removed][removed]
     [removed][removed]
     [removed][removed]
     [removed][removed]
     [removed][removed]
{
/exp:minimee:js} 

^ javascript links are being removed by forum, but you get the idea.

John D Wells
# 6
Developer
John D Wells

Thanks for the code sample - based on how you’re using Minimee, I’m confident that the version I’ve linked to should improve the accuracy and performance of Minimee, though I’m not sure if it will solve the +1k of empty files..  But there are a few bug fixes that could help, so let’s see what happens.

I’ll be anxiously waiting to hear how your tests go - this is crazy behaviour. Sorry for the inconvenience it’s causing.

Cheers,
John

shift2design
# 7
shift2design

Thanks John. Unfortunately the latest version didn’t resolve the odd empty file generation. The attached screenshot is from just 2 or 3 page views. Do you think relative or root-specific links may help performance (instead of using {site_url}? I doubt it would resolve this issue, but if it would affect performance I can switch them.

Anyhow, no, it does not appear to be resolved in latest version :( Thanks for the support, let me know what next step you would like to try? This is an extremely helpful addon and much appreciated.

John D Wells
# 8
Developer
John D Wells

Well the new version was supposed to improve the performance issue potentially associated with {site_url}.

Are you only using Minimee in the two instances that you pasted in, e.g. once for CSS, and once for JS?  Are you using it anywhere else?

Just to make sure we’re not chasing a ghost here, would you be willing to temporarily disable Minimee altogether?  I’m frankly beginning to suspect that the zero-kb files are not being made by Minimee.  You can globally disable Minimee via config, empty the cache folder, and then sit and wait to see if the empty files start re-appearing.

Cheers,
John

shift2design
# 9
shift2design

On the minimee settings I set it to disable and that (a) stops the pages from using the cache files as expected, and (b) stops the generation of the odd empty files. I delete all files from the /cache folder, and nothing else gets written to the folder. Later, when I re-enable minimee from the minimee settings page the cache files are created and then the generation of all the odd files begins.

shift2design
# 10
shift2design

Minimee is used for CSS and JS in the head, as well as once in the footer for JS. I do notice in the footer a few JS files are commented out correctly, but could there be a bug when minimee hits commented out JS links in the markup?

John D Wells
# 11
Developer
John D Wells

Rats…

OK, two things first:

You need to be sure that you’re using EE comments ({!—...—}) and not HTML comments if you’re trying to exclude file(s) from being processed by Minimee.

If you were previously using HTML comments, is it possible those files do not exist?  That could be a problem - Minimee is trying to cURL to a non-existent file.

If that’s not it, and you’re still willing to play along, please do the following:

1 - Change the Filename Hash Algorithm to “Sanitize” (under advanced settings if configuring Minimee via extension, or “hash_method” if configuring with config.php

2 - Turn on EE template debugging

3 - Optionally install the EE Debug Toolbar (easier reading of Minimee’s messages)

With template debugging turned on, Minimee should be writing log messages for every cache file it creates. By changing the filename hash algorithm, it shouldn’t obscure the filenames, so it may reveal which one(s) are causing this strange write.

I’m still flying a bit blind here, but I’m hoping that the logs may reveal something important…

Cheers,
John

shift2design
# 12
shift2design

Hi John,
I switched to EE comments to no avail. I also tried different setting combinations (disable combine, disable minify, etc) without any success. I tried what you requested above installing Debug Toolbar but I could not figure it out. I got the addon(s) installed but they would only appear in the CP not on front-end. Obviously I have the normal built-in debugging and output profiler visible. Debug Toolbar also said log file wasn’t writeable but I did some quick searching to figure this out as well without any luck. Also, it minimee is configured via extension in CP not config file FYI.

shift2design
# 13
shift2design

I’ve done it now. I broke the site, can’t get it back up…

John D Wells
# 14
Developer
John D Wells

Hi shift2design,

Oh goodness, how has it broken? Are you getting a white screen?  Strange that EE Debug Toolbar wasn’t installing for you, it’s EE minimum requirements are only EE 2.2.2.  However if you are using jquery on the front end, it apparently must be at least version 1.7 (https://github.com/mithra62/ee_debug_toolbar/wiki/Requirements).  So maybe uninstall that add-on first to see if your site comes back?

I’m about to duck into a Skype meeting right now so I will be unable to help out, but when I get out, I will check to see if you’ve updated anything.  You can also send me an email, johndwells at gmail.

Regards,
John

shift2design
# 15
shift2design

Yikes. Back up. That was scary.

I had uninstalled/disabled and deleted the addons and was back to trying to isolate certain minimee areas (of the 3 mentioned) when it went down. I enabled php errors and was getting a memory error but I have plenty of memory allowed. The error was in db_cache (CI). I went into config and changed $config[‘enable_db_caching’] = “y”; to “n” and it works. It’s back up and running but I can no longer set db_caching to yes.

Another odd issue, perhaps coincidence, is that a Facebook feed on the homepage now gives a content encoding error. It uses the REST addon, I temporarily disabled until I can look into that.

Needless to say, I don’t think I’ll be putting the EE Debug Toolbar back on. Even if unrelated, I can’t have this site go down like it just was.

1 of 2
1