Page MenuHomeIn-Portal Phabricator

INP-1759 Use delayed cached Mod-Rewrite URL invalidation
ClosedPublic

Authored by erik on Dec 18 2018, 10:39 AM.

Details

Reviewers
alex
Summary

Made batch deleting in place of individual ones

Test Plan
  1. go to Admin Console (login if needed)
  2. go to Configuration → Website → Advanced section
  3. ensure, that Enable SEO-friendly URLs mode (MOD-REWRITE) setting is enabled
  4. go to Front-End and visit 2 (or more) pages
  5. confirm that CachedUrls database table has records added, related to visited pages
  6. go to Admin Console (login if needed)
  7. go to Tools → System Tools section
  8. press Reset button in the Config Files → Reset Configs Files Cache and Parsed System Data subsection
  9. press Refresh button in the Templates → Refresh Theme Files subsection
  10. confirm that records in the CachedUrls database table have Hash values equals to 0 and empty Url values
  11. on the Front-End visit one more page
  12. go to Admin Console (login if needed)
  13. go to Configuration → Website → Scheduled Tasks section
  14. run delete_expired_cached_urls scheduled task
  15. confirm, that:
    • records with Hash values set to 0 were deleted from CachedUrls database table
    • records with other Hash values were not deleted from CachedUrls database table

Diff Detail

Repository
rINP In-Portal
Branch
branches/5.2.x
Lint
Lint ErrorsExcuse: full file re-formatting is not part of this task, event method name may start with capital letter
SeverityLocationCodeMessage
Errorcore/units/admin/admin_config.php:32PHPCS.E.CodingStandard.Arrays.Array.SpaceAfterKeywordCodingStandard.Arrays.Array.SpaceAfterKeyword
Errorcore/units/admin/admin_config.php:32PHPCS.E.Generic.PHP.LowerCaseKeyword.FoundGeneric.PHP.LowerCaseKeyword.Found
Errorcore/units/admin/admin_events_handler.php:1176PHPCS.E.CodingStandard.NamingConventions.ValidFunctionName.ScopeNotCamelCapsCodingStandard.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
Unit
No Unit Test Coverage
Build Status
Buildable 912
Build 912: arc lint + arc unit

Event Timeline

erik created this revision.Dec 18 2018, 10:39 AM
alex requested changes to this revision.Dec 19 2018, 3:49 AM
alex added inline comments.
core/kernel/managers/cache_manager.php
806

Test plan doesn't cover asserting that Url field is also empty.

core/units/admin/admin_config.php
33

Update test plan to perform unit config cache reset.


After patch is applied the scheduled task won't be registered by itself.

core/units/admin/admin_events_handler.php
1178

SQL isn't formatted correctly.

This revision now requires changes to proceed.Dec 19 2018, 3:49 AM
erik edited the test plan for this revision. (Show Details)Dec 19 2018, 6:58 AM
erik updated this revision to Diff 889.Dec 19 2018, 8:04 AM
erik edited edge metadata.

Improved SQL expression formatting, updated test plan.

alex requested changes to this revision.Dec 19 2018, 9:33 AM
alex added inline comments.
core/units/admin/admin_events_handler.php
1178–1179

For DELETE statements the DELETE FROM TableName part goes on 1st line.

This revision now requires changes to proceed.Dec 19 2018, 9:33 AM
erik updated this revision to Diff 890.Dec 19 2018, 9:42 AM
erik edited edge metadata.

Changed SQL expression formatting

alex accepted this revision.Dec 20 2018, 2:57 AM
alex edited the test plan for this revision. (Show Details)
This revision is now accepted and ready to land.Dec 20 2018, 2:58 AM
alex added a project: Restricted Project.Mar 16 2021, 3:56 AM
alex closed this revision.Mar 17 2021, 3:45 AM

Closing in favor of D356.