Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[5.2] Cache: Fix for counting the Number of Files correctly #43986

Merged
merged 3 commits into from
Feb 3, 2025

Conversation

pe7er
Copy link
Contributor

@pe7er pe7er commented Aug 26, 2024

Issue: The Maintenance: Clear Cache page does not display the correct number + size of cached files.

This PR corrects the Number of Files on the Maintenance: Clear Cache page.

Summary of Changes

When using Joomla's System - Page Cache plugin, an /administrator/cache/page folder with index.html file is created. When you visit one page on the front-end, you will cache one page.
However, the Maintenance: Clear Cache page shows 2 files under Number of Files because it also counts the index.html file (which is not a cached file). It's confusing to see that number.

Testing Instructions

  1. Switch on Joomla's System - Page Cache plugin

system-page-cache

  1. Goto the front-end and open one page. The Maintenance: Clear Cache counts 2 files.
  2. Open the website files, e.g. using an FTP client like FileZilla.
    You'll see just one cached file and the index.html.

files

Actual result BEFORE applying this Pull Request

You'll see too many cached files under Number of Files (and Size) because it includes the index.html:

maintenance-clear-cache

Expected result AFTER applying this Pull Request

You'll see the real number of cached files + size because the index.html is not counted as cache anymore:

after-pr

Link to documentations

Please select:

  • Documentation link for docs.joomla.org:

  • No documentation changes for docs.joomla.org needed

  • Pull Request link for manual.joomla.org:

  • No documentation changes for manual.joomla.org needed

@brianteeman
Copy link
Contributor

This is not correct.

When you turn on the cache plugin a pages folder is not created.

When you visit a page on the site then the folder is created with an index.html and any other cache files

When you delete the cache using the system menu the entire cache folder is deleted. That includes the index.hmtl file. Therefore the number of cached files includes the index.html file

@HLeithner HLeithner changed the base branch from 4.4-dev to 5.2-dev November 15, 2024 13:20
@HLeithner
Copy link
Member

This pull request has been automatically rebased to 5.2-dev.

@HLeithner HLeithner changed the title [4.4] Cache: Fix for counting the Number of Files correctly [5.2] Cache: Fix for counting the Number of Files correctly Nov 15, 2024
@pe7er pe7er removed the PR-4.4-dev label Jan 18, 2025
@rdeutz
Copy link
Contributor

rdeutz commented Jan 19, 2025

We create the index.html file because we don't want to have the files in the directory listed. So the index.html is not created as cached file. I think the PR is correct, even it doesn't makes a big difference.

@rdeutz
Copy link
Contributor

rdeutz commented Jan 19, 2025

I have tested this item ✅ successfully on 683a10f


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/43986.

@joomdonation
Copy link
Contributor

joomdonation commented Jan 19, 2025

We create the index.html file because we don't want to have the files in the directory listed. So the index.html is not created as cached file. I think the PR is correct, even it doesn't makes a big difference.

I remember the requirement to have index.html file in each folder was removed from long time ago, so I think the right solution if really needed would be not creating that file. Anyway, as you say, it doesn't makes a big difference, I don't really care if this PR is closed or merged.

@brianteeman
Copy link
Contributor

brianteeman commented Jan 19, 2025

We still need an index.html in any folder that would otherwise be distributed as an empty folder. The folder is not created on some systems if it is empty but in this case you are correct as these folders are not distributed so they do not need the index.html file, In other words the correct fix is not to create the file in the first place - not to exclude it from the count

@Hackwar
Copy link
Member

Hackwar commented Feb 3, 2025

I have tested this item ✅ successfully on 683a10f


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/43986.

@Hackwar
Copy link
Member

Hackwar commented Feb 3, 2025

RTC


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/43986.

@joomla-cms-bot joomla-cms-bot added the RTC This Pull Request is Ready To Commit label Feb 3, 2025
@chmst chmst enabled auto-merge (squash) February 3, 2025 09:22
@chmst chmst merged commit 78818e8 into joomla:5.2-dev Feb 3, 2025
3 checks passed
@joomla-cms-bot joomla-cms-bot removed the RTC This Pull Request is Ready To Commit label Feb 3, 2025
@Hackwar Hackwar added this to the Joomla! 5.2.4 milestone Feb 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants