Does W3 Total Cache modify original css/js - wordpress

I am looking to get w3 total cache going on my wordpress install.
I've done some searching, but I can't find out if the minification feature actually removes all the white space from your original css & js when you opt in for that.
I don't want to have all the white space removed, then need to make a change and have no readable code.
So ultimately I need to know whether I always have to keep my original somewhere else as another backup before turning this thing on.
Also, when you update something on your site, does w3 total cache rebuild the cache so the new post will appear on the home page for example.
Thanks for your input.

Well the way w3 total cache works is that it creates a cache folder in your wp-content. So after a few minutes it re-compiles all the css and js files and keep them in the cache folder. The website then directly links to these cached files, instead of your custom files.
In short it does not modify any existing files, it just creates new cached files. And when ever you make changes to your css/js, you just have to flush the cache and it will delete the previous cached files and create a new batch of cached files.
But your css/js files have to be enqueued, so this will let w3 total cache know which files it needs to minify and in which order. If you are using a wordpress theme then by default it should have all the enqueues in place.

Related

Wordpress old/updated/deleted CSS files are being served minified and I cant delete them. Why?

Backstory
We are using a LAMP stack (bitnami) to run a multisite Wordpress instance. This is the second time I have ran into a file that will not update when we push an update (We use git and pull the latest changes to the bitnami server).
We have noticed that when deleting (renaming for that matter) the file, it can still be retrieved by performing a GET on the resource (or the url in a browser). Also, if we were trying to make changes the changes do not come with the file - it is still the old file. Interestingly enough, the file is minified, which because of issues with this in the past we do not use any plugins that minify our CSS. So there should be no reason for it to be minified.
We have WP Total Cache - clearing all caches is successful but does not stop this from happening. (We used to use WP Super Cache, when this bug happened we decided to change plugins to WP Total Cache and purged the cache and it fixed the problem - but it is back and that no longer works).
I have also seen the trick where we can use a "?ver=###" query param on the url. This works but this would prevent us from using CloudFront for our files (currently disabled for all this testing so its not the problem either). Also I am not convinced it is a long term solution - or a solution at all since these minified files are being created and shouldnt be in the first place.
Additional information
It may not be helpful, but the files we have noticed this with are in a theme folder that is not technically an active theme. We just use the folder for additional resources that we have created ourselves. We reference them in the head of some pages.
Example:
/wp-content/themes/active-theme <- The active theme
/wp-content/themes/resources <- Our custom resources
Questions:
Where is this file being stored?
How can I delete it?
How can I prevent this from wasting our time ever again?
I found that the issue was with the bitnami server itself. The Apache2 module PageSpeed was causing the served files to be minified and cached resulting in the pages never updating no matter what we did on wordpress.
Apache:
To disable PageSpeed, comment out the following lines in your httpd.conf (/opt/bitnami/apache2/conf/httpd.conf)
#Include conf/pagespeed.conf
#Include conf/pagespeed_libraries.conf
Solution found here

WordPress styling does not display without clearing cache

I am building a WordPress website with an Underscore theme, it is hosted on flywheel. Everytime I make changes to a page, the styling style.css file is not picked up unless I do a hard reload/ clear cache.
Obviously I want it to load on everyone's computer immediately without the need to clear the cache. What is the reason for this? and how can I resolve it?
thanks.
You must change your theme version every time you make change in your style.css file. version will be appended to the URL as the query string. A version identifier is used to cache-bust the URL. The browser will detect the URL – with the query string – as a new and updated file rather than a cached resource.
see WordPress Theme CSS and JS Cache Busting

remove cookies when i need from visitors wordpress

I used wordpress and w3 total cache when i install this plugin to make my site more faster and everything good but if i try to edit any Cascading Style Sheet or JavaScript files i must delete cookies and cache to results of this edit appear.
What can i do to solve this problem ? If i try to make any changes this changes will not be appear to users, Their must be waited at lest month to view this changes.
Because that i need anything to delete cookies of users when i need to do it.
Thanks
What you are looking for is a technique called cache busting. Essentially what it is, is that your server and cache is working together and find a file on the server and in the cache with the same name. If your css/js would change name efter every edit a new css/js name would appear and thus a new request has to be made. That's cache busting you ya.
Read more about it here! https://gilbert.pellegrom.me/cache-busting-wordpress-style-css/

Wordpress css won't change unless I edit cache/combined.css

I've made changes to some css but they don't go into effect. I have to edit a file in cache/combined.css. Did wordpress create this file?
Yes.
It is part of a caching system to speed up to Wordpress site to run faster. You probably have a caching plugin enabled and what you would need to do is use the feature of that plugin (if there is one) to clear the cache.
Alternatively, you could just delete that file out of cache and it should re-cache the new file on next page load.

Wordpress setup: wp-config and content transfer

Can I delete the wp-config-sample.php after I save it as wp-config.php?
Also, is there a way I can transfer all my content from my old web pages which are not in a database to Wordpress, instead of manually adding all the content page by page? Keep in mind that I'm adding Wordpress to my GoDaddy hosting account.
Yes you can delete the sample configuration file if you want to.
You could theoretically write a script to take the content from your pages and insert them into Wordpress, but depending on the number of pages and the diversity of the structure/content of the pages it may be more worthwhile to do it manually.
Yes you can delete the file. There is no harm in it as the file name says its just a sample file.
Well copying the content from your old web pages is a tiring job. And as Ghills said its not an easy task to write a script to move the content as there are lot of other jobs involved when you write a post. Example : Categories, Tags, images etc.
Also you cannot trust the script completely as you will be moving a HTML content and dont know how wordpress editor will accept it.
Its better to o it manually.
Of course you can delete the file, because it is a sample. Most people rename it to just wp-config.php and modify it, but if you went through the graphical interface, there is no harm.
As for transferring, since you are making a static-to-live transfer, it is recommended to do this by hand so you will not make any errors with a script.
Although this is a hassle, the next time you need to move it, there are scripts as well as setups for a WordPress-to-WordPress transfer, WordPress-to-Typepad transfer, etc.

Resources