flipzoom / ProcessWire-AIOM-All-In-One-Minify

AIOM+ (All In One Minify) is a ProcessWire module to easily improve the performance of your website. By a simple function call Stylesheets, LESS and Javascript files can be parsed, minimized and combined into one single file. This reduces the server requests, loading time and minimizes the traffic. In addition, the generated HTML source code can be minimized and all generated files can be loaded over a cookieless domain (domain sharding).
MIT License
33 stars 26 forks source link

AIOM Cache conflict with ProcessWire's Page Render Cache #24

Closed klor closed 10 years ago

klor commented 10 years ago

AIOM seems to conclict with ProcessWire Core's cache. In AIOM I have set Lifetime to 2419200 for my CSS and JS files. In ProcessWire, I cache the pages -- here: Templates > Go to the Cache tab. and set Cache Time to 86400 (24 hours).

The reason for this issue is that AIOM updates the file name for the cached CSS and JS files while ProcessWire's Page Render cache does not update the file names simultaneusly.

File names cached by ProcessWire's Page Render Cache (in my case, these files do not exist to end-users / 404):

For instance, these file names were shown to me because I was logged in (valid files / 200):

<link rel="stylesheet" href="/site/assets/aiom/css_e4c680d6b59866248e0dc0a3317324a0.css">
<script src="/site/assets/aiom/js_cde06f61b83de6205615a30c87616efd.js"></script>

... and these were the file names presented to the end-user (the files did not exist / 404):

<link rel="stylesheet" href="/site/assets/aiom/css_xxxxxxxxxxxxxxxx999999999999.css">
<script src="/site/assets/aiom/js_xxxxxxxxxxxxxxxx999999999991.js"></script>

My workaround was to copy the contents of the AIOM files into static files outside the AIOM folder -- since this will allow cached PW-files to always point at the correct CSS/JS file. Example:

<link rel="stylesheet" href="/site/assets/style.css">
<script src="/site/assets/js_top.js"></script>
<script src="/site/assets/js_bottom.js"></script>
marvinscharle commented 10 years ago

Hello klor,

thank you for your report. We're planning to fix this issue in the next update.

Thank you in advance for your patience!

Marvin

marvinscharle commented 10 years ago

Hello klor,

I've added a fix for this bug. The fix is included in the AIOM 3.1.4 Beta repository.

Can you please verify if this solution could be working for your bug?

Thank you in advance,

Marvin