{"action":"created","issue":{"url":"https://api.github.com/repos/websharks/zencache/issues/495","labels_url":"https://api.github.com/repos/websharks/zencache/issues/495/labels{/name}","comments_url":"https://api.github.com/repos/websharks/zencache/issues/495/comments","events_url":"https://api.github.com/repos/websharks/zencache/issues/495/events","html_url":"https://github.com/websharks/zencache/issues/495","id":86438727,"number":495,"title":"Static CDN Filters should detect when Permalink Structure contains `.htm` or `.html`","user":{"login":"raamdev","id":53005,"avatar_url":"https://avatars.githubusercontent.com/u/53005?v=3","gravatar_id":"","url":"https://api.github.com/users/raamdev","html_url":"https://github.com/raamdev","followers_url":"https://api.github.com/users/raamdev/followers","following_url":"https://api.github.com/users/raamdev/following{/other_user}","gists_url":"https://api.github.com/users/raamdev/gists{/gist_id}","starred_url":"https://api.github.com/users/raamdev/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/raamdev/subscriptions","organizations_url":"https://api.github.com/users/raamdev/orgs","repos_url":"https://api.github.com/users/raamdev/repos","events_url":"https://api.github.com/users/raamdev/events{/privacy}","received_events_url":"https://api.github.com/users/raamdev/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/websharks/zencache/labels/bug","name":"bug","color":"fc2929"},{"url":"https://api.github.com/repos/websharks/zencache/labels/pro","name":"pro","color":"009800"},{"url":"https://api.github.com/repos/websharks/zencache/labels/ready%20for%20work","name":"ready for work","color":"ededed"},{"url":"https://api.github.com/repos/websharks/zencache/labels/static%20cdn%20filters","name":"static cdn filters","color":"009800"}],"state":"open","locked":false,"assignee":{"login":"raamdev","id":53005,"avatar_url":"https://avatars.githubusercontent.com/u/53005?v=3","gravatar_id":"","url":"https://api.github.com/users/raamdev","html_url":"https://github.com/raamdev","followers_url":"https://api.github.com/users/raamdev/followers","following_url":"https://api.github.com/users/raamdev/following{/other_user}","gists_url":"https://api.github.com/users/raamdev/gists{/gist_id}","starred_url":"https://api.github.com/users/raamdev/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/raamdev/subscriptions","organizations_url":"https://api.github.com/users/raamdev/orgs","repos_url":"https://api.github.com/users/raamdev/repos","events_url":"https://api.github.com/users/raamdev/events{/privacy}","received_events_url":"https://api.github.com/users/raamdev/received_events","type":"User","site_admin":false},"milestone":{"url":"https://api.github.com/repos/websharks/zencache/milestones/22","html_url":"https://github.com/websharks/zencache/milestones/Next%20Release%20(Pro)","labels_url":"https://api.github.com/repos/websharks/zencache/milestones/22/labels","id":1336542,"number":22,"title":"Next Release (Pro)","description":"Release Candidate due November 4th, 2015","creator":{"login":"raamdev","id":53005,"avatar_url":"https://avatars.githubusercontent.com/u/53005?v=3","gravatar_id":"","url":"https://api.github.com/users/raamdev","html_url":"https://github.com/raamdev","followers_url":"https://api.github.com/users/raamdev/followers","following_url":"https://api.github.com/users/raamdev/following{/other_user}","gists_url":"https://api.github.com/users/raamdev/gists{/gist_id}","starred_url":"https://api.github.com/users/raamdev/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/raamdev/subscriptions","organizations_url":"https://api.github.com/users/raamdev/orgs","repos_url":"https://api.github.com/users/raamdev/repos","events_url":"https://api.github.com/users/raamdev/events{/privacy}","received_events_url":"https://api.github.com/users/raamdev/received_events","type":"User","site_admin":false},"open_issues":14,"closed_issues":7,"state":"open","created_at":"2015-10-04T02:31:02Z","updated_at":"2015-11-28T17:53:15Z","due_on":"2015-12-11T05:00:00Z","closed_at":null},"comments":6,"created_at":"2015-06-09T04:17:59Z","updated_at":"2015-11-28T22:05:37Z","closed_at":null,"body":"If a site has a Custom Permalink structure of, say `/%year%/%monthnum%/%postname%.html`, and that site has enabled the ZenCache Static CDN Filters, then ZenCache will consider any links in the HTML that end with `.html` (or `.htm`) as static resources and rewrite the URLs with the configured CDN hostname. \r\n\r\nThat means that a link to a blog post `http://www.example.com/2015/04/welcome-home.html` would become something like `http://d2at82rz6jurc6.cloudfront.net/2015/04/welcome-home.html`, which is incorrect (we should only be rewriting URLs for static content, not for entire blog posts). \r\n\r\nWhat should happen is ZenCache should detect when the Permalink Structure contains `.htm` or `.html` and then add the necessary extension to the Static CDN Filters Blacklisted File Extensions.\r\n\r\n## Temporary Workaround\r\n\r\nYou can add `htm,html` to the Static CDN Filters Blacklisted File Extensions. That will prevent ZenCache from rewriting the URLs for the post links."},"comment":{"url":"https://api.github.com/repos/websharks/zencache/issues/comments/160339732","html_url":"https://github.com/websharks/zencache/issues/495#issuecomment-160339732","issue_url":"https://api.github.com/repos/websharks/zencache/issues/495","id":160339732,"user":{"login":"jaswsinc","id":1563559,"avatar_url":"https://avatars.githubusercontent.com/u/1563559?v=3","gravatar_id":"","url":"https://api.github.com/users/jaswsinc","html_url":"https://github.com/jaswsinc","followers_url":"https://api.github.com/users/jaswsinc/followers","following_url":"https://api.github.com/users/jaswsinc/following{/other_user}","gists_url":"https://api.github.com/users/jaswsinc/gists{/gist_id}","starred_url":"https://api.github.com/users/jaswsinc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jaswsinc/subscriptions","organizations_url":"https://api.github.com/users/jaswsinc/orgs","repos_url":"https://api.github.com/users/jaswsinc/repos","events_url":"https://api.github.com/users/jaswsinc/events{/privacy}","received_events_url":"https://api.github.com/users/jaswsinc/received_events","type":"User","site_admin":false},"created_at":"2015-11-28T22:05:37Z","updated_at":"2015-11-28T22:05:37Z","body":"Oh, good catch. I see this _was_ working properly, but now it is broken for some of those with more than one extension. Referencing: https://github.com/websharks/zencache-pro/blob/150821/src/includes/classes/CdnFilters.php#L544\r\n\r\nThat's my bad. I left that line out of the outline I posted in this issue prior.\r\n\r\n> Finally, what if someone changes their Permalink structure to include .htm after installing ZenCache?\r\n\r\nThe CDN Filter class runs as a part of the plugin (i.e., not in the early phase) but like any other plugin. So it will pick up changes right away.\r\n\r\nHowever, it would be great if we had some hooks that would reset the cache whenever a form is posted from certain menu pages in the Dashboard. For example, if you update your Permalink settings that could trigger a wipe of the cache. Same if you update your general options. Those are things that occur rarely on a live site, but maybe we can think about making ZenCache smarter."}}