-
Notifications
You must be signed in to change notification settings - Fork 17
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
Static CDN Filters should detect when Permalink Structure contains .htm
or .html
#495
Comments
Next ActionsAlter Default Whitelisted Extensions
|
- Excludes htm and html when permalink structure ends in .htm or .html See wpsharks/comet-cache#495
Next Pro Release Changelog:
|
ZenCache Pro v151002 has been released and includes changes from this GitHub Issue. See the ZenCache Pro v151002 release announcement for further details. This issue will now be locked to further updates. If you have something to add related to this GitHub Issue, please open a new GitHub Issue and reference this one (#495). |
@jaswsinc It appears that somewhere between v151002 and v151114, this bug was reintroduced. We received a report (see internal ticket) and I just tested Static CDN Filters with the following Permalink settings to confirm that ZenCache is rewriting all URLs that end with |
@jaswsinc I was just reviewing the code for this and this looks to me like the bug might be with the assumption that Looking at
Finally, what if someone changes their Permalink structure to include |
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 That's my bad. I left that line out of the outline I posted in this issue prior.
The 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. However, 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. |
aha! Great! I totally forgot that you added this. |
Next Pro Release Changelog:
|
ZenCache Pro v151220 has been released and includes changes worked on as part of this GitHub Issue. See the release announcement for further details. This issue will now be locked to further updates. If you have something to add related to this GitHub Issue, please open a new GitHub Issue and reference this one (#495). |
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.That means that a link to a blog post
http://www.example.com/2015/04/welcome-home.html
would become something likehttp://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).What 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.Temporary Workaround
You can add
htm,html
to the Static CDN Filters Blacklisted File Extensions. That will prevent ZenCache from rewriting the URLs for the post links.The text was updated successfully, but these errors were encountered: