CORS and other errors appearing with caching module enabled...

Hello,

We are currently using A10 Thunder for load balancing, but we also have the caching module enabled for our in-house web applications.

Fairly recently, we began creating Angular (8) applications that call .NET CORE 3.x APIs. We develop these locally and things work fine, but when we ported them to our development environment that uses IIS and Windows servers through the A10 thunder, the API calls returned CORS errors. We could not replicate these locally, so our admin disabled the caching module on our A10 and everything began to work again.

We also noticed that Angular apps built with development configuration (i.e., non-optimized) run fine with the A10 Cache enabled, but optimized Angular apps (built with "ng build --prod") did not. With caching turned off, the optimized apps also began working.

We're not really sure where to begin troubleshooting this issue. Is the A10 looking for additional headers with caching? Is there some configuration we need on the A10 to address this issue? Any guidance or direction would be appreciated!

Thank you!

Tagged:

Comments

  • tmitsuhatatmitsuhata Member, Administrator, A10ers admin

    Hi trobbins,

    What kind of reason do you see on the CORS error? If it's header "missing", you may want to try to insert it using http template. Once it's created, apply it to the appropriate virtual port of the virtual server (VIP).

    slb template http add-cors
       response-header-insert Access-Control-Allow-Origin:*
    

    Note: if you want to specify the source web page, use URL (e.g. https://10.0.0.10) instead of *.

    Also, since you're seeing the issue related to RAM cache, you can try a few configuration changes. For example, removing extra header (age , via) and/or exclude some pages/ contents form caching. For example,

     slb template cache rc1
      disable-insert-age
      disable-insert-via
      policy uri .css nocache
    

    Anyways, I would recommend you open a case with A10 TAC for further troubleshooting.

    Hope this helps.

  • trobbinstrobbins Member

    Thanks for your reply. We have disabled the cache on the a10 for now and that has solved all of our problems. We're not sure if we'll need it going forward, but, if we end up needing it, the advice you posted will definitely help us move forward. I forwarded this post on to members of my team for discussion. Thanks again!

Sign In or Register to comment.