Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Benjamin Ravn 34 posts 67 karma points
    Feb 29, 2016 @ 11:13
    Benjamin Ravn
    0

    Caching and development

    I've just installed the new Umbraco 7.4.1, and now I'm experiencing some hardcore caching of my views. Every time I make a change in a view, I'll have to "touch" the web.config to see the change in the browser. Errors are also cached.

    I know it's a caching issue, but I don't know where to disable og change the settings for caching when in development mode.

    I btw loved the new editor for Document Types! Awesome stuff guys!

  • M T 35 posts 212 karma points
    Feb 29, 2016 @ 12:46
    M T
    0

    Like you say Umbraco is quite aggressive when it comes to caching, its nice when your site is live but in development it can be an issue.

    Templates don't always cache but when they do a simple build will sort this out, however most of the time Umbraco isn't responsible for caching templates.

    Ctrl + F5 = Browser cache refresh

    Or if you're using IIS you can refresh the app pool and website.

    If none of this works you can disable Umbraco caching from umbracosettings.config , set XmlCacheEnabled to false. As your templates are stored in DB this will cause a new DB call to fetch the template on each page load, However I would not recommend this as you will get a big decrease in performance.

    Regards M

  • Benjamin Ravn 34 posts 67 karma points
    Mar 04, 2016 @ 07:57
    Benjamin Ravn
    0

    None of your suggestions work.

    It isn't a browser cache problem, and I'm pretty sure the "problem" is within Umbraco, since I don't experience the problem on any of my other Umbraco-sites.

    I'll have to either "touch" the web.config or refresh the app pool in order to refresh the cache. Refreshing the website won't refresh the cache.

    I really hope there is a solution for this caching madness :-)

  • Benjamin Ravn 34 posts 67 karma points
    Mar 04, 2016 @ 10:31
    Benjamin Ravn
    0

    I can add to the issue, that I'm able to save and publish changes to the view, and the changes are viewable in the template, but it's still caching the template-file.

    We can therefore conclude that there's only a problem with caching of the template-file.

    It makes it really difficult to develop.

    Doesn't anyone else have this problem?

  • Benjamin Ravn 34 posts 67 karma points
    Mar 04, 2016 @ 10:47
    Benjamin Ravn
    0

    After I wrote the last comment, I had to test something.

    I'm on a Mac and using Parallels with Windows 8. The website installation is located on my mac, and therefor not in the Windows environment.

    I've just copied the installation into the Windows environment, and that solved the caching problem.

    Until now it has worked fine pointing IIS to a Mac folder.

    Does anyone else have the same problem, and know how to solve it?

  • M T 35 posts 212 karma points
    Mar 04, 2016 @ 13:11
    M T
    0

    im having the same issue now, forcing an error from the web.config and the fixing that error sorts it for me. Must be a bug as this has only started happening since 7.4.1 for me.

  • Rahul Sekhar 9 posts 85 karma points
    Sep 26, 2016 @ 02:35
    Rahul Sekhar
    0

    I've been having the same caching problem when using a shared folder on Parallels. No idea how to solve it though, I've shifted to a windows folder for the moment.

  • shinsuke nakayama 105 posts 246 karma points
    Feb 21, 2017 @ 07:30
    shinsuke nakayama
    0

    Hi guys,

    We are also having the same issue, did you guys have any solution to this? I wonder if Umbraco is caching all the cshtml files and listening to any change events to optimise the process.

    if so, can we disable this caching mechanism for people who's running Windows on Mac?

  • Dmitriy Skudnov 39 posts 64 karma points
    Mar 20, 2017 @ 20:21
    Dmitriy Skudnov
    0

    Hi guys.

    Does anybody have found the solution? I have the same issue. Umbraco 7.5.11

    Only pool restarting helps.

  • shinsuke nakayama 105 posts 246 karma points
    Mar 21, 2017 @ 00:05
    shinsuke nakayama
    0

    EDIT: This temporary solution is for Mac user using parallel to run the Windows, and running the website via network sharing between mac and windows.

    Hi Dmitriy,

    Some of our developers end up hosting the Umbraco in the Windows environment.

    I have also created a PowerShell script to listen to any file change event, and update the web.config accordingly so it triggers the reset.

    The script looks something like this. (Sorry couldn't find the latest version, this version goes infinite loop, just need to filter the web.config)

    You also have to insert "AppVersionUpdater" in the web.config

    $folder = $PSScriptRoot + "\"
    $filter = '*.*'
    $webConfig = $folder + 'application_web\web.config'
    
    $fsw = New-Object IO.FileSystemWatcher $folder, $filter -Property @{
     IncludeSubdirectories = $true
     NotifyFilter = [IO.NotifyFilters]'FileName, LastWrite'
    }
    
    Register-ObjectEvent $fsw Changed -SourceIdentifier AppVersionUpdater -Action {
    
     $doc = (Get-Content $webConfig) -as [Xml]
     $obj = $doc.configuration.appSettings.add | where {$_.Key -eq 'appVersion'}
     $obj.value = ([convert]::ToInt32($obj.value) + 1).ToString();
    
     $doc.Save($webConfig)
    }
    

    and to unregister

    # unregister the FileSystemWatcher's Created event
    Unregister-Event -SourceIdentifier AppVersionUpdater
    

    AppVersionUpdater is the name of the event I created

  • Dmitriy Skudnov 39 posts 64 karma points
    Mar 29, 2017 @ 15:52
    Dmitriy Skudnov
    0

    Hi guys.

    I have figured out, that in my web.config fcnMode was set to "Disabled". When i have changed it to "Single", problems disappeared. So instead of

    <httpRuntime requestValidationMode="2.0" enableVersionHeader="false" targetFramework="4.5" maxRequestLength="51200" fcnMode="Disabled" />
    

    should be

    <httpRuntime requestValidationMode="2.0" enableVersionHeader="false" targetFramework="4.5" maxRequestLength="51200" fcnMode="Single" />
    
Please Sign in or register to post replies

Write your reply to:

Draft