How to purge CDN cache programmatically for an item? - caching

After integration of azure CDN in our site, we found that the cache is not purged while replacing the file. This is happening only for PDF file type. We want to purge the cache on replace of the file. Please help us if anyone has faced the similar issue and purged the CDN cache programmatically.
Thanks

S.Ray ,
You can use the below Rest API doc to purge content from Azure CDN:
https://learn.microsoft.com/en-us/rest/api/cdn/cdn/endpoints/purgecontent
In the request body, under contentPaths parameter, you can provide the path to the content to be purged. It can describe a file path or a wild card directory.
Thanks!

Related

CKEditor issue not reading from cloud storage

After installing the Mandeeps Cloud Storage module, we have confirmed it is enabled as a connector. We have confirmed, using the DNN site assets the files are being read from Azure. We do have an issue with the CKeditor, reading files locally and not using the connector. Is there a setting or fix for this.
I havent used the Mandeeps cloud storage but their knowlegdebase is pretty good and it seems to cover this topic
"you can use existing Azure folders by adding a folder of the same name in Add Folder TextBox in FileManger"
https://www.mandeeps.com/support/knowledgebase/cloud-storage-folder-types-windows-azure
there is also a default file location for the ckeditor that can be configured from the site settings page
HTML editor manager

Updating a hosted 5.3 laravel web site in BLUEHOST

I'am currently working on a hosted web site which was developed with Laravel 5.3 in Bluehost . So for futher developments I have folled below procedure.
Compressed the folder and downloaded it in to local machine.
Created a public folder and moved relevant folders into it.
Via php artisan serve develpment started and everything went fine.
After the development only 4 files to be changed in the server. So I have opened the related files in server and updated the coding by just copy and paste.
When I refresh the web url after updating files I can see that php
and html updated correctly but css and javascript was not
updated. So I checked the files again but they are almost updated. But
when I view the source I can see that both css and javascript
files have not updated.
So I just created new files in the server with different names and linked them into the blade.php files and then css and javascript working fine .Also when I view the source they are also updated.
Can anyone say what is the reason for this?
This happens due to caching most of the time.
If you are using Cloudflare as a service purge the cache and give it a try.
Steps to purge your domain cache due to Cloudflare
STEP 01
Login to your Cloudflare account and select the domain you want to purge the cache.
STEP 02
Go to the caching tab.
STEP 03
In there, there are two options you can select. one is, you can purge the cache on selected file by simply given the URL of the file you want to purge the cache.
the second one is you can purge all cache in Cloudflare server under your domain by clicking purge everything button.

Compatibility issues with WordPress super cache and minify plugins

I'm having a big problem. I have WordPress super cache and I installed a plugin call minify. Add to use my back up, then I took off minify, but WordPress super cache is not caching now. It gave me this message:
Fetching http://mmolist.com/ to prime cache: OK
Fetching first copy of http://mmolist.com/: OK (1.html)
Fetching second copy of httpLINK ABOVE: OK (2.html)
The pages do not match! Timestamps differ or were not found!
I tried 775 and 777 in the folder, but no luck.
First and foremost, you can't use minify with WP Super Cache whatsoever. If you do, you will get that message. Even if you use a CDN and enable minify there you will continue to get that message. I was experiencing that issue as well and the minify in the CDN was my culprit so I had to disable it. Here is an article on how to do it https://www.msgdigital.com/wp-super-cache-tester-pages-not-match-fix/
" The pages do not match! Timestamps differ or were not found!"
You get this error in WP super cache when you test page cache. Since you are using a minify plugin, do not enable the option to minify HTML.
If you are using CDN service like Cloudflare see a detail post on this link
Hope this helps.

Cloudfront CDN integration with Magento

I have searched a lot but still didn't get the way to sync media, css and js data with Cloudfront CDN.
Please help and let me know how can I do this thing.
Thanks in advance!!
I have not worked a lot with Magento, but a straight approach can be scheduling a cron task in your management node to sync up your static files with a S3 bucket. S3cmd is your friend here.
Then simply set your Cloudfrount distribution's Origin to your S3 bucket and set the static resource URLs in Magento to use your Cloudfront endpoint.

Avoid Direct Download Link of files

I am using Wordpress and Easy Digital Download plugin to sell digital files.
I have the following how-to questions:
How to avoid a user to see or to use direct download link?
How to create a download link that has an expiration like session?
How to secure a wp-contents/uploads folder?
You might be interested in this:
deny direct access to a folder and file by htaccess
simply put a .htaccess file with the content "deny from all" in the folder.
Then only scripts from your webspace should be able to read files from there.
This should be a first step. You would need a php-file serving the data instead of accessing those files directly.
Eg like this: http://www.kavoir.com/2009/05/php-hide-the-real-file-url-and-provide-download-via-a-php-script.html
(as I am not aware of wordpress plugins, maybe just google for them, this explains how to write those in php - if you cant do that youre pretty much stuck to wordpress plugins)
Nah, Nah, Nah... It's easy man update your plugin, and check your settings...
Step 2. You will see in you plugin settings, that it has 24 hours expiration date download link in forwarded email
"WP Secure Links" is WordPress plugin at codecanyon that lets you create a secure link to downloadable files.
http://codecanyon.net/item/wp-secure-links/4418678
http://sixthlife.net/product/wp-secure-links/
for securing the uploads folder needs some good .htaccess work
check the comments section of this, its explained
Still relevant in 2020 so I have written a small plugin that enables secure and temporary downloads in Wordpress:
WP DISPATCHER
It is free and simple. Check it out :)

Resources