Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

URL to combined CSS / JS changes, creates issue with static page caching #28

Open
khromov opened this issue Oct 2, 2014 · 2 comments
Open

Comments

@khromov
Copy link

khromov commented Oct 2, 2014

For some reason, sometimes MinQueue decides to regenerate all the combined files. Since it doesn't clear the page cache in conjunction to this, CSS / JS is now broken, because the cached template still has references to the old MinQueue combiner URL:s. I've tried multiple cache plugins and it's always the same issue.

I guess the root issue is, what could possibly trigger MinQueue to randomly rewrite the files.

@donaldG
Copy link

donaldG commented May 18, 2015

Bump on this. I haven't experienced it, yet, but we use Akamai for a lot of our sites. I'd hate for the cached version, even if just for a few minutes before it refreshes, to be looking for a file that doesn't exist. This plugin seems freaking incredible as I've been testing it locally & would be great to use in our team of folks that may not feel comfortable setting up something like Node/Grunt/Gulp/etc.

@donaldG
Copy link

donaldG commented May 18, 2015

After checking out the Better WP Minify plugin, perhaps a resolution for this would be allowing 'pretty' names for the files, or something similar. I tend to like this plugin a bit more than BWP Minify just because there are less options/distractions. Perhaps something as simple as 'minqueue' w/o the hash. Then maybe each subsequent js/css minqueued file could just be 'minqueue-1', 'minqueue-2', etc.

Maybe something like:

    private function get_group_handle( $group ) {

    if ( empty( $this->group_handles[$group] ) ) {

        $data = array();
        $i = 0;
        foreach( $this->process_queue[$group] as $handle ) {

            $data[$handle] = array( 'version' => $this->class->registered[$handle]->ver );

            $file_path = $this->site_root .  $this->get_asset_path( $handle );
            if ( $this->checks_last_modified && file_exists( $file_path ) )
                $data[$handle]['modified'] = filemtime( $file_path );
        $i++;
        }
            $this->group_handles[$group] = $this->prefix.'-'.$i;

    }

    return $this->group_handles[$group];

}

I'm guessing the purpose of the hash is to give as much info as possible about when the files were created? Maybe there's a way to still include that info without it being dynamically placed into the name. I dunno, just thinking aloud here!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants