In this SharePoint tutorial, we will discuss how to resolve Cannot make a cache safe URL for filename, file not found. Please verify that the file exists under the layouts directory error which comes in SharePoint 2010.
Recently while working with SharePoint 2010. I was trying to giving a path to jQuery files using SharePoint designer, but it gave an error. The full error message is Cannot make a cache safe URL for “1033/http://siteurl/scripts/jquery-1.6.2.min.js”, file not found. Please verify that the file exists under the layouts directory.
I have created a folder inside SharePoint Style Library and putting all my .js files inside that directory. Now when I am giving the full path I am getting that error.
Cannot make a cache safe URL for filename, file not found SharePoint
There are different solutions for this, some might work and some might not work for your problem.
- Check whether the file exists in the physical folder or not. If not presented there you can put there and check.
- Sometimes you will get the error as “Cannot make a cache safe URL for “1033/sp.debug.js”, file not found. Please verify that the file exists under the layouts directory. ” For this, you can copy the sp.debug.js file and put it inside C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\TEMPLATE\LAYOUTS\1033.
- Another solution is you can add Localizable = false attribute to SharePoint:ScriptLink like below:
- Apart from this, you can also give file path simply using script tag like below (provided file should be deployed inside StyleLibrary):
The above solution works for me and I put all the js files inside the Style Library folder in the SharePoint site.
You may like following SharePoint tutorials:
- Add a custom web part to the page layout in SharePoint 2013 or SharePoint 2010
- Create visual web part in SharePoint 2013/2016 using visual studio
- How to Change Favicon in SharePoint Online/2013/2016
- Change add new item link SharePoint 2010/2013
- Cannot open office documents from SharePoint 2013 with Office 2010
- How to find SharePoint uls log details based on correlation id using PowerShell
I hope this SharePoint tutorial helps to resolve error Cannot make a cache safe URL for filename, file not found. Please verify that the file exists under the layouts directory.
I am Bijay from Odisha, India. Currently working in my own venture TSInfo Technologies in Bangalore, India. I am Microsoft Office Servers and Services (SharePoint) MVP (5 times). I works in SharePoint 2016/2013/2010, SharePoint Online Office 365 etc. Check out My MVP Profile.. I also run popular SharePoint web site SPGuides.com