NOTE: I am using the s3fs plugin in order to store assets in an AWS S3 bucket, so if you are not using that your results could differ
This is probably not a suggested method of forcing the system to clear the asset cache, but I was in the same boat and for some reason my file systems got mixed up during multiple edits between local, development, and the live site. For the live site I was only able to get the styles working if the files were not aggregated using the Performance page.
As far as I know, the system will not update the CSS or JS files unless a change has been detected. Aside from going in and making a change to every file I started digging into the database. I found that the file location for the CSS and JS assets were located in the "cache_default" table with a value of something like below:
BACKUP YOUR DATABASE BEFORE GOING FURTHER!
In case you mess anything up, CYA!
- I went through and deleted all entries that were a CSS or JS file.
Be careful not to delete the directory reference entries that just
have the JS and CSS folders.
- THEN, since I was using s3fs I went into the "s3fs_file" table and did the same thing.
- I went back into the Performance page, enabled the CSS and JS aggregation, and saved.
- Then cleared the site cache after that. This seemed to re-generate the
CSS and JS assets, re-built the asset table data, and the site was
back to normal!
I did have to dump the DB tables and import into my dev and local environments in order to mimic the new asset names, but this seemed to work like a charm.
SIDE NOTE: I am wondering if there would be some way for Drupal to add a style versioning system? Maybe that we could change the sites CSS versioning after major changes in order to have this done automatically? or maybe this is just something I will need to build my next module for!!