Jump to content

ProCache question


kaz
 Share

Recommended Posts

A question about the Pro Shop module ProCache:
I have read through what the module offers in the shop. I'm interested in HTML, CSS and JS Minification and Merge. That sounds great.

How do I implement the whole thing? In the description I read:

"No code changes to your site are required, just check the box to enable and it takes care of it for you. Thoguh should you prefer it, ProCache also provides API-functions for merge/minify that you can use from your template files."

Does this mean that I don't have to make any changes to the code, ProCache minifies the structure of my website alone and temporarily, the full code of the css and templates remains?

If I load templates from content blocks, different css and js files via src in my template, will it be minified in total? Are comments from HTML, PHP, JS and CSS files automatically removed?

Does this work so easily, without any changes to the code of my templates? Excuse my question, I just want to understand before I buy, whether the module is worth the price for my need.

Link to comment
Share on other sites

5 hours ago, kaz said:

Does this mean that I don't have to make any changes to the code, ProCache minifies the structure of my website alone and temporarily, the full code of the css and templates remains?

Yes! No updates on code, it really works out of the box in most cases! It grabs the output of your templates and right before rendering it does it all, swaps the script, style tags and there you go, minified and merged.

5 hours ago, kaz said:

If I load templates from content blocks, different css and js files via src in my template, will it be minified in total? Are comments from HTML, PHP, JS and CSS files automatically removed?

What I do when I have this requirements is to just minify what is required on every page, and whatever libraries that are just loaded to work on a specific context I load them separately, you can add "?NoMinify" to the src url to let know ProCache that a specific file should not be loaded.

Comments are removed from HTML for sure! Not sure if from CSS too, I can't remember now. 

<!-- 
this might include jquery, htmx or some other library you'll be using everywhere, and are originally placed like this in your template file:
<script src="/site/templates/js/jquery.js">
<script src="/site/templates/js/somethingesle.js">
ProCache turns it into the following, right before output:
-->
<script src="/site/assets/ProCache/minified.pwpc.js">
  
<!-- that other fancy slideshow library you use in a specific block, this won't get minified/merged in the block above -->
<script src="/site/templates/js/slideshow.min.js?NoMinify">

 

  • Like 3
Link to comment
Share on other sites

12 minutes ago, Rudy said:

Just a note, ProCache will only work on Apache (perhaps LiteSpeed) web server. If you are using Nginx, you have to translate the ProCache-generated htaccess to nginx directives.

I can confirm it works in LiteSpeed, at least in my hosting (Knownhost)

  • Like 2
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...