Database size increases with Remove Unused CSS
Remove Unused CSS stores information in the database and in some scenarios it will grow quite large. This might seem alarming but MySQL is capable of storing and searching over a lot of data, as long as proper indexing is used on the columns that needs to be searched, which is the case for our tables.
We use these tables:
This is where we store the CSS and JS resources from your site. Files that are reused across your site will only be stored in the database once. But it can grow large if:
- There are lots of CSS and JS files on your site
- There are unique files loaded on each or many pages. A common example of this are the custom CSS files generated by Elementor for each post/page - they look like this:
- There are files whose version changes frequently or on every page load - this means it will be added to the database every time the cache is created (when we check for new resources). This has the potential to cause a very large increase in DB size. We have a related Github issue for this problem, with further details..
- There are many pages on your site.
Every 30 days WP Rocket runs a cleanup to remove any unused resources from this table.
This is where we store the Used CSS for every cached page of your site. This can grow large if:
- There are many cached pages
- There is a large amount of CSS per page
- Options that create additional cache files are enabled - separate cache files for mobile devices, WebP caching
- Their optimization/combination options for CSS/JS should be disabled